Execute a JavaScript when the user starts moving/skipping to a new position in the video:
More "Try it Yourself" examples below.
The onseeking event occurs when the user starts moving/skipping to a new position in the audio/video.
Tip: The onseeking event is the opposite of the onseeked event.
Tip: Use the currentTime property of the Audio/Video Object to get the current playback position.
The numbers in the table specify the first browser version that fully supports the event.
Event | |||||
---|---|---|---|---|---|
onseeking | Yes | 9.0 | Yes | Yes | Yes |
In HTML:
In JavaScript:
In JavaScript, using the addEventListener() method:
Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions.
Bubbles: | No |
---|---|
Cancelable: | No |
Event type: | Event |
Supported HTML tags: | <audio> and <video> |
DOM Version: | Level 3 Events |
This example demonstrates the difference between the onseeking event and onseeked event:
Using the currentTime property of the Video Object to display the current playtime position when the user starts to skip to a new position:
Execute a JavaScript when the user starts moving/skipping to a new position in the audio: