Javascript examples for DOM Event:ontimeupdate
The ontimeupdate event occurs when the playing position of an audio/video has changed.
Bubbles | No |
---|---|
Cancelable | No |
Supported HTML tags: | <audio> and <video> |
<!DOCTYPE html> <html> <body> <video controls ontimeupdate="myFunction(this)"> <source src="your.mp4" type="video/mp4"> <source src="your.ogg" type="video/ogg"> Your browser does not support HTML5 video. </video>/*from w ww . ja v a 2 s . co m*/ <p>Playback position: <span id="demo"></span></p> <script> function myFunction(event) { document.getElementById("demo").innerHTML = event.currentTime; } </script> </body> </html>