<video id="video1" controls="controls">
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
myVid=document.getElementById("video1");
myVid.addEventListener("durationchange", function()
alert("The video duration has changed");
<p>Video courtesy of <a href="http://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>