You can determine if a property is supported loopand set it to true.
For browsers that don't support it, you can simply bind a media event endedand fire it:
var myVideo = document.getElementById('videoId');
if (typeof myVideo.loop == 'boolean') {
myVideo.loop = true;
} else {
myVideo.addEventListener('ended', function () {
this.currentTime = 0;
this.play();
}, false);
}
myVideo.play();
source
share