HTML Audio/Video DOM loadedmetadata Event
HTML Audio/Video DOM Reference
Example
Display a message when the video's metadata is loaded:
myVid=document.getElementById("video1");
myVid.onloadedmetadata=alert("Meta data for video loaded");
Try it »
Definition and Usage
The loadedmetadata event occurs when the metadata of the specified audio/video has been loaded.
The metadata of audio/video includes: duration, dimensions (video only), and text tracks.
While the audio/video is loading, the following events occur in order:
- loadstart
- durationchange
- loadedmetadata
- loadeddata
- progress
- canplay
- canplaythrough
Browser support





All major browsers support the loadedmetadata event.
**Note:** Internet Explorer 8 and earlier versions do not support this event.
Syntax
In HTML: