<video id="v" autoplay>
<source src="1.mp4" type="video/mp4">
</video>
<script>
var c = 0;
f = [
"1.mp4",
"2.mp4",
"3.webm"
];
var v = document.getElementById('v');
v.addEventListener('ended', function(e) {
c = (c < f.length-1)?++c:0;
v.src = f[c];
v.play();
});
</script>