HTML Audio/Video DOM loadedmetadata Event
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);
Advertisement