In JavaScript:
object.onseeking = function(){
myScript};
This example uses the HTML DOM to assign an "onseeking" event to a video element.
<!DOCTYPE html> <html> <body> <p>Move to a new position in the video.</p> <video controls id="myVideo"> <source src="video.mp4" type="video/mp4"> <source src="video.ogg" type="video/ogg"> Your browser does not support HTML5 video. </video>// www . j av a2 s . c om <p id="demo"></p> <script> document.getElementById("myVideo").onseeking = function() {myFunction()}; function myFunction() { document.getElementById("demo").innerHTML = "Seek operation began!"; } </script> </body> </html>
Bubbles: | No |
---|---|
Cancelable: | No |
Event type: | Event |
Supported HTML tags: | <audio> and <video> |