onseekingEvent
Example
Execute JavaScript when the user starts repositioning the video's playback position:
Try it Yourself »
More examples are included at the bottom of this article.
Definition and Usage
The onseeking event triggers when the user starts repositioning the playback position of video/audio (audio/video).
Tip:The opposite of the onseeking event isonseekedevent.
Tip:Use currentTimeto set or return the current playback position of video/audio (audio/video).
Browser Support
The numbers in the table specify the first browser version that fully supports the event.
| Event | |||||
|---|---|---|---|---|---|
| onseeking | Yes | 9.0 | Yes | Yes | Yes |
Syntax
In HTML:
In JavaScript:
In JavaScript, using the addEventListener() method:
Note:Internet Explorer 8 and earlier IE versions do not support theaddEventListener()method.
Technical Details
| Bubbles: | No |
|---|---|
| Cancelable: | No |
| Event type: | Event |
| Supported HTML tags: | <audio>, <video> |

More Examples
Example
The following example demonstrates the difference between the onseeking event and the onseeked event:
Try it Yourself »
Example
When the user starts repositioning the playback position, you can use the currentTime property of the Video object to display the current playback position:
var x = document.getElementById("myVideo");
// If seeking starts, add the seeking event to the <video> and execute the corresponding function
x.addEventListener("seeking", myFunction);
function myFunction() {
// Display the current playback position of the video in the <p> element with id="demo"
document.getElementById("demo").innerHTML = x.currentTime;
}
Try it Yourself »
Example
Execute JavaScript when the audio starts repositioning the playback position:
Try it Yourself »
Event Object Other Extensions