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 に答える