Latest web development tutorials

onseeking event

Event Object Reference Event objects

Examples

JavaScript is executed when the user begins to reposition the video playback position:

<Video onseeking = "myFunction ()">

try it"

Bottom of this article contains more examples.


Definition and Usage

Onseeking event fires when the user starts to reposition the video / audio (audio / video).

Tip: onseeking event contrary onseeked event.

Tip: Use currentTime to set or return the video / audio (audio / video) playback of the current position.


Browser Support

Figures in the table represent the first browser to support this version of events.

event
onseeking Yes 9.0 Yes Yes Yes


grammar

In HTML:

<Elementonseeking = "myScript"> try

In JavaScript:

object .onseeking = function () {myScript }; try

JavaScript, use the addEventListener () method:

object .addEventListener ( "seeking", myScript ); try

Note: Internet Explorer 8 and earlier versions of IE do not support addEventListener () method.


technical details
Whether to support the bubble: No
It can be canceled: No
Event Type: Event
Supported HTML tags: <Audio>, <video>


Examples

More examples

Examples

The following examples demonstrate the difference between onseeking events and onseeked event:

<Video onseeking = "myFunction ()" onseeked = "mySecondFunction ()">

try it"

Examples

When the user begins to reposition the playback position, you can use currentTime property in the Video object to display the current playback position:

// Get id = "myVideo" the <video> element
var x = document.getElementById ( "myVideo");

// If you start looking, namely <video> seeking to add an event and execute response function
x.addEventListener ( "seeking", myFunction);

function myFunction () {
// Display id = "demo" of <p> elements in the current video playback position
. Document.getElementById ( "demo") innerHTML = x.currentTime;
}

try it"

Examples

JavaScript is executed at the beginning to reposition the audio playback position:

<Audio onseeking = "myFunction ()">

try it"


Event Object Reference Event objects