我正在尝试在我的 HTML5 视频标签中使用字幕,但我无法让它工作。我认为问题在于视频源不是本地文件。有谁知道我该如何解决这个问题?
<html>
<head>
<style id="stndz-style"></style>
<meta name="viewport" content="width=device-width">
</head>
<body>
<video id="video" controls autoplay="" name="media">
<source src="http://localhost:8888/" type="video/mp4">
<track label="Dutch" kind="subtitles" srclang="nl" src="/home/ubuntu/Desktop/scripts/example.vtt" default>
</video>
</body>
</html>
这是我的example.vtt:
WEBVTT
00:01.000 --> 00:04.000
Never drink liquid nitrogen.
00:05.000 --> 00:09.000
- It will perforate your stomach.
- You could die.
事实证明,cromium 不允许我使用本地文件是问题所在。所以我的解决方法是像这样运行铬:
chromium --allow-file-access-from-files
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句