根据我的搜索,Chrome 具有播放 MKV 视频的编解码器。
但是,到目前为止,我还没有发现任何允许使用 Javascript/HTML5 选择 MKV
和 AVI
文件中可用的音轨的东西。
谁能告诉我如何做到这一点?
我的想法是创建一个网络播放器来播放这种类型的文件,可以选择音轨和显示字幕。
最佳答案
audioTracks
属性允许您执行此操作。但是,如此处的文档所述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.
我已经试过了,它至少适用于以 mkv
文件作为源的 video
元素。
https://stackoverflow.com/questions/60934356/