getvideoprogress();
function getvideoprogress() {
setTimeout(function () {
var vid = document.getElementById("video1");
var currentTime=vid.currentTime.toFixed(1);
if(currentTime==1.2){
//触发
return false;
}
console.log(currentTime);
getvideoprogress();
}, 50);
}
html5 video获取实时播放进度的方法
最新推荐文章于 2025-05-28 10:49:54 发布
本文介绍了一个使用JavaScript实现的视频播放进度监测方法。通过递归调用getvideoprogress()函数并利用setTimeout设置定时器,可以实时获取视频当前播放的时间点,并在达到特定时间时触发相应操作。
1162

被折叠的 条评论
为什么被折叠?



