我的字幕文件 if .txt
<track src="subtitle.txt" kind="subtitles" srclang="ko" label="ko">
我可以将字幕作为 .txt 文件吗?
video.textTracks[0].mode = "showing";
video.textTracks[0].text;
我尝试了这个,但我没有定义
谢谢
最佳答案
您的字幕文件需要格式化。 我建议您使用 .vtt 文件。
The HTML element is used as a child of the media elements and . It lets you specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files) — Web Video Text Tracks or Timed Text Markup Language (TTML). The Embed Text Track element
以下是一些有用的链接:
关于javascript - 视频字幕不起作用我的字幕文件是 .txt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57621686/