1

这让我发疯!

video.addEventListener 'ended', (e) =>
    e.target.currentTime = 0
    console.log e.target.currentTime
    # 5.33 seconds NOT 0

视频播放,结束事件被调用,但 currentTime 没有改变。

4

1 回答 1

1

这可能会帮助您:

video = document.getElementById('video');
begin_play  = 50;
play_video_frist = true; //if you want to run only frist time    
video.addEventListener("play", capture, false);

function capture(event) 
{
     if (event.type == "play") {
         if (play_video_frist) {
             play_video_frist = false;
             video.currentTime = begin_play;
          }
     }
}
于 2014-08-26T10:12:31.353 回答