我想在单击特定按钮时捕获 HTML5 视频的当前运行时间。 这是我的代码
var vid = document.getElementById("video1");
$('#cap-cue').click(function(){
var curtime = vid.currentTime;
alert(curtime);
});
这适用于大多数浏览器,但不适用于 chrome。
最佳答案
问题(至少与 Chrome 相关)可能出在服务器端。
将 Header set Accept-Ranges bytes
放入您的 .htaccess
(参见 this answer)
关于javascript - html 视频标签的 JS currentTime 在 chrome 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27964533/