popcorn.js 中的定期事件

Periodic event in popcorn.js

如何将 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();