Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html> 
<html> 
<body> 
<video id="myVideo" width="320" height="176" controls ondurationchange="myFunction(this)">
  <source src="mov_bbb.mp4" type="video/mp4">
  <source src="mov_bbb.ogg" type="video/ogg">
  Your browser does not support HTML5 video.
</video>
<script>
function myFunction(x) {
  alert("The duration of this video is : " + x.duration + " seconds");
}
</script> 
<p>This example demonstrates how to use the "ondurationchange" attribute on a VIDEO element.</p>
<p><strong>Note:</strong> When the video is loaded, the "ondurationchange" event will occur, it changes from "NaN" to the actual duration of the video.</p>
<p>Video courtesy of <a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>
</body> 
<!-- Mirrored from www.w3schools.com/tags/tryit.asp?filename=tryhtml5_att_ondurationchange by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:34:20 GMT -->
</html>