HTML Audio / Video DOM seeked event
HTML Audio / Video DOM Reference
Examples
Prompted text when the user completes re-set the video playback position:
vid.onseeked = function () {
alert ( "Seek operation completed!");
};
try it"
Bottom of this article contains more examples.
Definition and Usage
Seeked event is triggered when the user has to move / jump to the audio / video (audio / video) to a new location.
Tip: Instead event seeked event is seeking event.
Tip: Use the Audio / Video object currentTime property to get the video playback position.
Browser Support
Figures in the table represent the first browser to support this version of events.
event | |||||
---|---|---|---|---|---|
seeked | Yes | 9.0 | Yes | Yes | Yes |
grammar
In HTML:
In JavaScript:
JavaScript, use the addEventListener () method:
Note: Internet Explorer 8 and earlier versions of IE do not support addEventListener () method.
technical details
Supported HTML tags: | <Audio> and <video> |
---|---|
Supported JavaScript Objects: | Audio, Video |
More examples
Examples
This example demonstrates the difference between seeking and seeked event event:
try it"
Examples
When the user completes move / jump to the new position of the video, use currentTime property Video object to display the current playback position:
var vid = document.getElementById ( "myVideo");
// For the <video> add seeked event, after the operation is completed the addressing function is executed
vid.addEventListener ( "seeked", myFunction);
function myFunction () {
// Display the id = "demo" p element <video> current playback position
. Document.getElementById ( "demo") innerHTML = vid.currentTime;
}
try it"
Examples
A message appears upon completion of move / jump to the audio playback position in a new user:
aud.onseeked = function () {
alert ( "Seek operation completed!");
};
try it"
HTML Audio / Video DOM Reference