HTML Audio / Video DOM seeking event
HTML Audio / Video DOM Reference
Examples
Pop-up text message when the user begins to move / jump to a new video playback position:
vid.onseeking = function () {
alert ( "Seek operation began!");
};
try it"
Bottom of this article contains more examples.
Definition and Usage
When seeking to trigger an event in the user begins to move / jump to the new audio / video (audio / video) playback position.
Tip: Instead event seeking event is seeked event.
Tip: Use the Audio / Video object currentTime property Gets playback position.
Browser Support
Figures in the table represent the first browser to support this version of events.
event | |||||
---|---|---|---|---|---|
seeking | 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 begins to move to a new location, use the Video object currentTime property displays the current playback position:
var vid = document.getElementById ( "myVideo");
// For the <video> seeking to add an event, if you start addressing a function begins execution
vid.addEventListener ( "seeking", myFunction);
function myFunction () {
// Display id = "demo" of the p element <video> player positions
. 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.onseeking = function () {
alert ( "Seek operation began!");
};
try it"
HTML Audio / Video DOM Reference