<html>
<body>
<video id="myVideo" controls src="movie.ogg">
Your browser does not support the video tag.
</video>
<p>Click the button to change the URL of the video.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
var x = document.getElementById("myVideo");
function myFunction() {
isSupp = x.canPlayType("video/mp4");
if (isSupp == "") {
x.src = "mov_bbb.ogg";
} else {
x.src = "mov_bbb.mp4";
}
x.load();
document.getElementById("demo").innerHTML = "Video Courtesy of Big Buck Bunny - www.bigbuckbunny.org";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_video_src2 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:17:52 GMT -->
</html>