Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Audio/Video DOM seeked Event

HTML Audio/Video DOM seeked Event

HTML audio/video Tag Reference HTML Audio/Video DOM Reference

Example

Display a text message when the user finishes setting a new playback position for the video:

var vid = document.getElementById("myVideo");

vid.onseeked = function() {

    alert("Seek operation completed!");

};

Try it »

The bottom of this article contains more examples.


Definition and Usage

The seeked event is triggered when the user has moved/jumped to a new position in the audio/video.

Tip: The opposite event of seeked is seeking events.

Tip: Use the Audio/Video object's currentTime property to get the playback position of the video.


Browser support

The numbers in the table indicate the version number of the first browser to support the event.

Events
seeked Yes 9.0 Yes Yes Yes

Syntax

In HTML:

<

audio|video

onseeked="

myScript

">

Try it

In JavaScript:

audio|video

.onseeked=function(){

myScript

};

Try it

In JavaScript, use the addEventListener() method:

audio|video

.addEventListener("seeked",

myScript

);

Try it

Note: Internet Explorer 8 and earlier IE versions do not support addEventListener() method.


Technical Details

Supported HTML tags:
Supported JavaScript objects: Audio, Video

More examples

Example

This example demonstrates the difference between the seeking and seeked events: