HTML Audio/Video DOM Reference
When the user starts moving/skipping to a new position in the video, alert some text:
More "Try it Yourself" examples below.
The seeking event occurs when the user starts moving/skipping to a new position in the audio/video.
Tip: The seeking event is the opposite of the seeked 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 | |||||
---|---|---|---|---|---|
seeking | 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.
Supported HTML tags: | <audio> and <video> |
---|---|
Supported JavaScript objects: | Audio, Video |
This example demonstrates the difference between the seeking event and seeked 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:
When the user starts moving/skipping to a new position in the audio, alert some text: