我絕不是Web開發人員,所以如果我錯失了一些明顯的東西,請原諒我。我檢查了這個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.我做錯了什麼?任何幫助將被appriciated。在HTML5視頻標籤中訪問Google雲端硬盤中的WebVTT字幕
這是我的JS代碼。當我在我的電腦上使用本地文件時,字幕軌道文件工作正常,但是當我使用drv與.mp4文件相同時,它不再有效。
<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>
感謝您的答覆,但我不認爲這有關我在做什麼的。基本上,我使用HTML5視頻標籤播放視頻和字幕,但是我的問題是代碼在本地URL上正常工作,但在上傳到Google Drive之後,代碼只能使用.mp4 URL而不使用.vtt URL。 –