Horje

How to alert when metadata for the audio is loaded

Play Audio.

index.html
Example: HTML

<!DOCTYPE html>
<html>
<body>
<audio id="myAudio" controls> <source src="https://file-examples.com/index.php/sample-audio-files/sample-mp3-download/" type="audio/ogg"> <source src="https://file-examples.com/index.php/sample-audio-files/sample-mp3-download/" type="audio/mpeg"> Your browser does not support the audio element.
</audio>
<script>
let aud = document.getElementById("myAudio");
aud.onloadedmetadata = function() { alert("Metadata for audio loaded");
};
</script>
</body>
</html>

Output should be:

How to alert when metadata for the audio is loaded



Single Articles
Example of HTML onloadedmetadata Event Attribute HTML Media Events Attribute
Definition and Usage of HTML onloadedmetadata Event Attribute HTML Media Events Attribute
Browser Support of HTML onloadedmetadata Event Attribute HTML Media Events Attribute
Syntax of HTML onloadedmetadata Event Attribute HTML Media Events Attribute
Attribute Values of HTML onloadedmetadata Event Attribute HTML Media Events Attribute
Technical Details of HTML onloadedmetadata Event Attribute HTML Media Events Attribute
How to alert when the meta data of the video has loaded HTML Media Events Attribute
How to alert when metadata for the audio is loaded HTML Media Events Attribute


Related Articles
List of Media Events HTML Media Events Attribute
HTML onabort Event Attrribute HTML Media Events Attribute
HTML oncanplay Event Attribute HTML Media Events Attribute
HTML oncanplaythrough Event Attribute HTML Media Events Attribute
HTML ondurationchange Event Attribute HTML Media Events Attribute
HTML onended Event Attribute HTML Media Events Attribute
HTML onerror Event Attribute HTML Media Events Attribute
HTML onloadeddata Event Attribute HTML Media Events Attribute
HTML onloadedmetadata Event Attribute HTML Media Events Attribute
HTML onloadstart Event Attribute HTML Media Events Attribute

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