Seek Events

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


.on('absolutePositionReady')

Triggered when .getAbsolutePosition() is ready to return data.

Returns an object with the following:

ValueDescription
ready booleanIndicates whether .getAbsolutePosition() is (true) or is not (false) prepared to return absolute position data
startDateTimestringExposes the original broadcast date and time of the stream (in msec)


NOTE: The following are used to determine startDateTime:
- #EXT-X-PROGRAM-DATE-TIME in HLS
- presentationTimeOffset in DASH
type stringIdentifies the event being listened for (absolutePositionReady)

.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)
startnumberStart 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.

ValueDescription
N/ANo value returned

.on('time')

While the player is playing, this event fires when the playback position updates. This may occur as frequently as 10 times per second.

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)
metadata objectMutable properties defining the resource

See: time.metadata
position numberPlayback position (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: time.seekRange
type stringIdentifies the event being listened for (time)
viewable booleanIf the player is viewable or not

time.metadata

ValueDescription
currentTime 8.19.0+ numberThe position of the stream before the player seeks (in seconds)

time.seekRange

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