Using Video as a background of Web Pages

In order to make the User Interface of the WebSite better we could even use a video as the background of any website using HTML5. The video formats supported by HTML5 presently are mp4 ,ogv and WebM. So the code snippets you would require are as given below :

CSS of the video Tag should be something like this..

#video_tag { position: absolute; top: 0px; right: 0px; min-width: auto; min-height: auto; width: auto; height: auto; z-index: -1000; overflow: hidden; } 

The Javascript for the rotation of various videos should be something like this :

var index = 1,
playlist = ['new.MP4', 'new.MP4', 'new.MP4'], // The list of videos that needs to be rotated.
video = document.getElementById('video_tag');
video.addEventListener('ended', rotate_video, false);
function rotate_video() 
{
video.setAttribute('src', playlist[index]);
video.load();
index++;
if (index >= playlist.length) { index = 0; }
}

The HTML of the video tag should be something like this :

<video id="video_tag" preload="auto" autoplay="true" loop="loop" muted="muted" volume="0"> 
<source src="new.MP4" type="video/mp4">