HTML Audio/Video DOM loadedmetadata Event

❮ HTML Audio/Video DOM Reference

Example

//Accessing the element
var vid = document.getElementById("myVideo");

//Creating a function
vid.onloadedmetadata = function() {
    alert("Video metadata has need loaded");
};

Meaning

The loadedmetadata event run when the browser has loaded meta data for the audio/video.


Standard Syntax

HTML:

<element onloadedmetadata="myScript">

JavaScript:

object.onloadedmetadata=function(){myScript};

JavaScript, using the addEventListener() method::

object.addEventListener("loadedmetadata", myScript);



Browser Support




Status







Technical Details

Type Description
Supported HTML tags: <audio> and <video>
Supported JavaScript objects: Audio, Video
❮ HTML Audio/Video DOM Reference