Horje

Example of HTML ondurationchange Event Attribute

It will alert that the duration of the video has changed. It will happen the audio duration has changed.
index.html
Example: HTML
<!DOCTYPE html> 
<html> 
<body> 

<script>
function myFunction() {
  alert("The audio duration has changed");
}
</script> 

<video controls ondurationchange="myFunction()">
  <source src="https://download.samplelib.com/mp3/sample-3s.mp3" type="video/mp4">
  <source src="https://download.samplelib.com/mp3/sample-3s.mp3" type="video/ogg">
  Your browser does not support HTML5 video.
</video>

<p>Video courtesy of <a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>

</body> 
</html>

Output should be:

Example of HTML ondurationchange Event Attribute




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Media Events Attribute
Uploaded by:
Admin