【发布时间】:2017-08-13 12:14:19
【问题描述】:
我绝不是网络开发人员,如果我遗漏了一些显而易见的东西,请原谅我。我检查了这个question,发现它可以与 .mp4 文件一起正常工作,但 WebVTT 文件 (.vtt) 不可用。 I think the player recognized the subtile as the player bar show "CC" button but in the video, subtitle was not displayed.我做错了吗?任何帮助都将不胜感激。
这是我的 JS 代码。当我在计算机上使用本地文件时,字幕轨道文件工作正常,但当我使用与 .mp4 文件相同的 drv 时,它不再工作了。
<script>
function myFunction1() {
document.getElementById("myVideo").src= "https://www-drv.com/~email/gd/Testing/NG!-01.mp4";
document.getElementById("mySubtitle").src= "https://www-drv.com/~email/gd/Testing/01.vtt";
document.querySelector('video').load();
}
</script>
这是我的视频代码
<video width="1280" height="720" controls="controls" preload="none">
<source id="myVideo" src="https://www-drv.com/~email/gd/Testing/NG!-01.mp4" type="video/mp4">
<track id="mySubtitle" src="https://www-drv.com/~email/gd/Testing/01.vtt" kind="subtitles" srclang="id" label="English" default>
</video>
【问题讨论】:
标签: javascript html google-drive-api html5-video