これは私を夢中にさせています!
video.addEventListener 'ended', (e) =>
e.target.currentTime = 0
console.log e.target.currentTime
# 5.33 seconds NOT 0
ビデオが再生され、終了イベントが呼び出されますが、currentTime は変更されません。
これは私を夢中にさせています!
video.addEventListener 'ended', (e) =>
e.target.currentTime = 0
console.log e.target.currentTime
# 5.33 seconds NOT 0
ビデオが再生され、終了イベントが呼び出されますが、currentTime は変更されません。
これはあなたを助けることができるかもしれません:
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;
}
}
}