Edit This Code:
<!DOCTYPE html>
<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>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy