onseeked event
JavaScript is performed after the user repositions where the video is playing:
Try it out . . .
More examples are included at the bottom of this article.
Definitions and usages
The onseeked event is triggered after the user repositions the playing position of the video/audio/video.
Tip: The opposite of the onseeked event is the onseeking event.
Tip: Use currentTime to set or return the current location of video/audio playback.
Browser support
The numbers in the table support the version number of the first browser for the event.
Event | |||||
---|---|---|---|---|---|
onseeked | Yes | 9.0 | Yes | Yes | Yes |
Grammar
In HTML:
In JavaScript:
In JavaScript, use the addEventListener() method:
Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions of IE.
Technical details
Whether to support bubbling: | No |
---|---|
Can I cancel: | No |
Types of events: | Event |
Supported HTML tags: | <audio>, <video> |
More instances
The following example demonstrates the difference between an onseeking event and an onseeked event:
Try it out . . .
After the user repositions the video playback location, you can use the currentTime property of the Video object to display the current playback location:
var x =document.getElementById("myVideo");
If the search is complete, add the seeked event to the slt;video, and execute the function of the response
x.addEventListener("seeked", myFunction);
function myFunction() {
Displays the current playing position of the video in the element of id"demo"
document.getElementById("demo").innerHTML = x.currentTime;
}
Try it out . . .
Perform JavaScript after the audio repositions the playback location:
Try it out . . .
The event object