我想在Chrome浏览器中播放带字幕的MKV文件,以便查看本地视频文件。使用上述方法/代码在Microsoft Edge中成功了,但是当我使用Chrome时,无法看到字幕(无法使用Firefox,因为MKV不受支持)。
<video id="video" controls preload="metadata" style="width:80%;height:80%">
<source src="file.mkv" type="video/mp4">
<source src="file.mkv" type="video/webm">
<track label="language one" kind="subtitles" srclang="en" src="sub.vtt">
<track label="language two" kind="subtitles" srclang="en" src="sub.vtt">
</video>
- chrome MKV 播放器 //(根目录)
- file.mkv //(视频文件)
- file.vtt //(字幕文件)
- RUN.html //(用于显示视频的html文件)
这种方法基于这个github仓库 "https://github.com/iandevlin/iandevlin.github.io/tree/master/mdn/video-player-with-captions"
我尝试过:
- 使用不同的字幕格式 (vtt, stl, ass, srt)