0

so I want to have a short video intro for my website then it will go fade out and straight to my main site. Sorta like this: http://www.firecrackerfilms.com/.

This is my Code:

<video id="video" src="Inception.mp4" autoplay height: 100% width=100%>

The video works fine but after it finishes it just stays there and doesn't go to the main page. Any tips or solutions would be greatly appreciated!

Thanks!

1 Answers1

1

In window.onload, bind an event handler to the video element's "ended" event. In that handler, you can either redirect the page or load content with AJAX. Something like:

window.onload= function () {
    document.getElementById("video").onended = function () {
        // video done playing
    };
};
Ian
  • 50,146
  • 13
  • 101
  • 111