In JavaScript, using the addEventListener()
method:
object.addEventListener("seeked",
myScript);
This example uses the addEventListener()
method to attach a "seeked" 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>// w w w. j a v a2 s . co m <p id="demo"></p> <script> document.getElementById("myVideo").addEventListener("seeked", myFunction); function myFunction() { document.getElementById("demo").innerHTML = "Seek operation completed!"; } </script> </body> </html>
Bubbles: | No |
---|---|
Cancelable: | No |
Event type: | Event |
Supported HTML tags: | <audio> and <video> |