<button onclick="changeSource()" type="button">Change Video</button> <br> <video id="video1" controls="controls" autoplay="autoplay"> <source id="mp4_src" src="/statics/demosource/mov_bbb.mp4" type="video/mp4"> <source id="ogg_src" src="/statics/demosource/mov_bbb.ogg" type="video/ogg"> Your browser does not support HTML5 video. </video> <script> myVid=document.getElementById("video1"); function changeSource() { isSupp=myVid.canPlayType("video/mp4"); if (isSupp=="") { myVid.src="/statics/demosource/movie.ogg"; } else { myVid.src="/statics/demosource/movie.mp4"; } myVid.load(); } </script> <p>Video courtesy of <a href="http://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>