Javascript examples for DOM Event:Element Event Attribute
The onloadedmetadata event occurs when meta data for the specified audio/video has been loaded.
Bubbles | No |
---|---|
Cancelable | No |
Supported HTML tags: | <audio> and <video> |
<!DOCTYPE html> <html> <body> <video controls id="myVideo"> <source src="your.mp4" type="video/mp4"> <source src="your.ogg" type="video/ogg"> Your browser does not support HTML5 video. </video>/*from ww w. jav a 2s.co m*/ <script> document.getElementById("myVideo").onloadedmetadata = function() {myFunction()}; function myFunction() { console.log("Meta data for video loaded"); } </script> </body> </html>