Playing with HTML 5: The Video Tag

I was playing with HTML5 again. Today, I was trying to use the new tag <video> to embed the intro video of the game Planetarian. I tried a few times using JS to detect the end of the video but only realized the correct way of doing it is as follows.

var video = document.getElementsByTagName(‘video’)[0];
video.addEventListener(“ended”, function() { //Do stuff here after end of video }, false);

According to online resources, this code should work in Chrome, Firefox as well as IE9! =D

Unfortunately, I just uninstalled IE9, so I haven’t tested it on IE9. =P

Intro Video of My Online Planetarian
Intro Video in My Online Planetarian