Seek Events

These API calls are used to retrieve and update the current media playback position.


.on('seek')

Fired after a seek has been requested either by scrubbing the control bar or through the API.

Returns an object with the following:

ValueDescription
currentTime 8.19.0+ numberThe position of the stream before the player seeks (in seconds).
duration 8.19.0+ numberDuration of the current playlist item (in seconds).
position numberThe position of the player before the player seeks (in seconds).
seekRange 8.19.0+ objectTime range representing how much video is available for seeking in DVR streams or for buffering in live streams

See seek.seekRange
offset numberThe position that has been requested to seek to (in seconds).

seek.seekRange

ValueDescription
end numberEnd time of the range relative to the currentTime of the stream (in seconds)
start numberStart time of the range relative to the currentTime of the stream (in seconds)


📘

NOTE

Seeking is often based on keyframe availability. The actual position the player will eventually seek to may differ from what was specified.


.on('seeked')

Triggered when video position changes after seeking, as opposed to on('seek') which triggers as a seek occurs.

ValueDescriptionType
-No value returned-

.on('time')

While the player is playing, this event is fired as the playback position gets updated. This may occur as frequently as 10 times per second.

Returns an object with the following:

ValueDescriptionType
durationDuration of the current playlist item in seconds.Number
positionPlayback position in seconds.Number
viewableIf the player is viewable or not.Number