Video

 

var iterations = 1;

document.getElementById(‘iteration’).innerText = iterations;

myVideo.addEventListener(‘ended’, function () {

if (iterations < 5) {

this.currentTime = 0;
this.play();
iterations ++;

document.getElementById(‘iteration’).innerText = iterations;

}

}, false);

Iteration: