<!DOCTYPE html>
<html lang="en-US">
<body>
<video style="width:100%;height:330px" ondurationchange="myFunction()" controls>
<source src="/hawk.mp4" type="video/mp4">
</video>
<script>
function myFunction(){
alert("Final Duration is changed");
}
</script>
<p><strong>Note</strong> : ondurationchange event will not trigger for every second when the video is playing, instead it triggers when the final duration(video length) metadata is received from the server.</p> </body>
</html>