This example demonstrates how to assign an "onloadeddata" event to a video element.
<!DOCTYPE html> <html> <body> <video controls onloadeddata="myFunction()"> <source src="video.mp4" type="video/mp4"> <source src="video.ogg" type="video/ogg"> Your browser does not support HTML5 video. </video>/*from w ww. java2s.c om*/ <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = "Browser has loaded the current frame"; } </script> </body> </html>
Bubbles: | No |
---|---|
Cancelable: | No |
Event type: | Event |
Supported HTML tags: | <audio> and <video> |