浏览器可以本地播放打包的字幕(包含在视频文件中)吗?

Can browsers natively play packaged subtitles (included in the video file)?

如您所知,最常见的视频容器文件类似于包含多个其他文件的 zip 存档:实际视频、不同语言的多个音频文件以及字幕和字幕的多个文本文件。如果这些曲目包含在视频文件中,则称为 packagedafaik。

现在,虽然 HTML 提供 <track> 元素来引用其他文件,但浏览器是否能够在不同的 打包 曲目中进行选择并显示不同的字幕?

浏览器支持如何?

不,目前他们不能,尽管 HTML 标准鼓励浏览器供应商实施此类控制。

该标准允许每个媒体资源有多个音频和视频轨道,并通过 JavaScript:

公开它们

A media resource can have multiple embedded audio and video tracks. For example, in addition to the primary video and audio tracks, a media resource could have foreign-language dubbed dialogues, director's commentaries, audio descriptions, alternative angles, or sign-language overlays.

4.8.12.10 具有多个媒体轨道的媒体资源

此外,该标准鼓励对不同的音轨和字幕进行控制。

If the [control] attribute is present, […] the user agent should expose a user interface to the user. This user interface should include features to […] change the display of closed captions or embedded sign-language tracks, select different audio tracks or turn on audio descriptions […]

4.8.12.13 User interface

根据 can i use audioTracks,一些供应商已经支持或正在努力提供支持。