Play dual audio MKV/AVI video with HTML5

Viewed 614

From what I searched for, Chrome has the codecs to play MKV videos. But, so far, I haven't found anything that allows, using Javascript / HTML5, to select the audio tracks available in the MKV and AVI files.

Can anyone give me a light on how to do this?

My idea was to create a web player to play this type of file, with the possibility to select the audio track and display subtitles.

1 Answers

The audioTracks property allows you to do this. However, as stated in the documentation here https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/audioTracks

From version 37: this feature is behind the enable-experimental-web-platform-features >preferences (needs to be set to enabled). To change preferences in Chrome, visit >chrome://flags.

I've tried this and it works at least for video elements that have an mkv file as a source.

Related