如何将 popcorn.js 配置为每次视频时间更新时发出事件?我应该只使用视频元素的 timeupdate 事件吗?
目前,我只能在特定开始时间设置事件:
var p = Popcorn( "#video" )
// play the video
.play()
// set the volume to zero
.volume( 0 )
.code({
start: 1,
end: 3,
onStart: function( options ) {
document.getElementById( "test1" ).innerHTML = "Yes";
},
onEnd: function( options ) {
document.getElementById( "test1" ).innerHTML = "No";
}
})
最佳答案
来自official Docs它说您每次更新玩家时间时都会捕获事件
var pop = Popcorn("#video");
pop.on("timeupdate", function( e ) {
console.log( "timeupdate fired!");
});
pop.play();
关于javascript - popcorn.js 中的周期性事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44808532/