THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

onseeked Event

Event Object Reference Event Object

Example

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

<video onseeked="myFunction()">
Try it Yourself »

More "Try it Yourself" examples below.


Definition and Usage

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

Tip: The onseeked event is the opposite of the onseeking event.

Tip: Use the currentTime property of the Audio/Video Object to get the current playback position.


Browser Support

The numbers in the table specify the first browser version that fully supports the event.

Event
onseeked Yes 9.0 Yes Yes Yes

Syntax

In HTML:

<element onseeked="myScript">
Try it Yourself »

In JavaScript:

object.onseeked=function(){myScript};
Try it Yourself »

In JavaScript, using the addEventListener() method:

object.addEventListener("seeked", myScript);
Try it Yourself »

Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions.


Technical Details

Bubbles: No
Cancelable: No
Event type: Event
Supported HTML tags: <audio> and <video>
DOM Version: Level 3 Events

Examples

More Examples

Example

This example demonstrates the difference between the onseeking event and onseeked event:

<video onseeking="myFunction()" onseeked="mySecondFunction()">
Try it Yourself »

Example

Using the currentTime property of the Video Object to display the current playtime position when the user is finished moving/skipping to a new position:

// Get the <video> element with id="myVideo"
var x = document.getElementById("myVideo");

// Attach a seeked event to the <video>, and execute a function when a seek operation completes
x.addEventListener("seeked", myFunction);

function myFunction() {
    // Display the current position of the video in a <p> element with id="demo"
    document.getElementById("demo").innerHTML = x.currentTime;
}
Try it Yourself »

Example

Execute a JavaScript when the user is finished moving/skipping to a new position in the audio:

<audio onseeked="myFunction()">
Try it Yourself »

Event Object Reference Event Object