Javascript DOM onseeked Event

Introduction

Execute a JavaScript when the user is finished moving to a new position in the video:

This example demonstrates how to assign an "onseeked" event to a video element.

View in separate window

<!DOCTYPE html>
<html>
<body>
<p>Move to a new position in the video.</p>

<video controls onseeked="myFunction()">
  <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 va 2  s .  c  om

<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("demo").innerHTML = "Seek operation completed!";
}
</script>

</body>
</html>

The onseeked event occurs when the user is finished moving to a new position in the audio/video.

The onseeked event is the opposite of the onseeking event.

You can use the currentTime property of the Audio/Video Object to get the current playback position.

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



PreviousNext

Related