Play html5 video. As soon as it finishes, the script below is called, which leads to the next video, which it adds to the next line and starts playing it. How to turn this into a loop as soon as the second video finishes the game, does it add the third video, etc.?
<div> <video id="video0" autoplay> <source src="video0.mp4" /> </video> </div>
.
var i=0 $('video'+i).on("ended", function() { i++; $(this).parent().append('<br /><video id="video' + i + '" autoplay><source src="video' + i + '.mp4" /></video>'); };
source share