I am trying to use a script on three videos using the same ID (#vid) on the same page. At the moment only one video seems to be able to use the script.
var video = document.getElementById('vid')
// When the 'ended' event fires
video.addEventListener('ended', function(){
// Reset the video to
video.currentTime = 0;
// And play again
video.load();
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…