<video onloadedmetadata="myFunction()"> - Javascript DOM Event

Javascript examples for DOM Event:onloadedmetadata

Description

The onloadedmetadata event occurs when meta data for the specified audio/video has been loaded.

Summary

Bubbles No
Cancelable No
Supported HTML tags: <audio> and <video>

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<video controls onloadedmetadata="myFunction()">
  <source src="your.mp4" type="video/mp4">
  <source src="your.ogg" type="video/ogg">
  Your browser does not support HTML5 video.
</video>// w w  w .j  a  va  2s.  com

<script>
function myFunction() {
    console.log("Meta data for video loaded");
}
</script>

</body>
</html>

Related Tutorials