First, your HTML markup looks like this:
<video id="awesome_video" src="first_video.mp4" autoplay />
Second, your JavaScript code will look like this:
<script type="text/javascript">
var index = 1,
playlist = ['first_video.mp4', 'second_video.mp4', 'third_video.mp4'],
video = document.getElementById('awesome_video');
video.addEventListener('ended', rotate_video, false);
function rotate_video() {
video.setAttribute('src', playlist[index]);
video.load();
index++;
if (index >= playlist.length) { index = 0; }
}
</script>
And last but not least, your CSS:
#awesome_video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
This will create a video element on your page that starts playing the first video right away, then iterates through the playlist defined by the JavaScript variable. Your mileage with the CSS may vary depending on the CSS for the rest of the site, but 100% width/height should do it on a basic page.