有没有办法播放 html5 视频,在视频中的已知点停止并执行 javascript?
最佳答案
是的,试试这个。您必须使用 currentTime 属性。从那里开始并从那里开始你的javascript函数。这就是您要找的吗?
var vid = document.getElementById("video");
//Add a timeupdate listener
video.addEventListener("timeupdate", function(){
//Check for video properties from within the function
if (this.currentTime == 5)
this.pause();
//cal javascript
}
}
关于javascript - 是否可以在 html5 视频中嵌入 Action ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41076283/