Horje

How to alert that the duration of the audio has changed

The audio duration has changed.

index.html
Example: HTML
<!DOCTYPE html> 
<html> 
<body> 

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

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


</body> 
</html>

Output should be:

How to alert that the duration of the audio has changed




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