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:
Value | Description | |
---|---|---|
ready boolean | Indicates whether .getAbsolutePosition() is (true ) or is not (false ) prepared to return absolute position data | |
startDateTimestring | Exposes the original broadcast date and time of the stream (in msec)
| |
type string | Identifies 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:
Value | Description |
---|---|
currentTime 8.19.0+ number | The position of the stream before the player seeks (in seconds) |
duration 8.19.0+ number | Duration of the current playlist item (in seconds) |
position number | The position of the player before the player seeks (in seconds) |
seekRange 8.19.0+ object | Time range representing how much video is available for seeking in DVR streams or for buffering in live streams See seek.seekRange |
offset number | The position that has been requested to seek to (in seconds) |
seek.seekRange
Value | Description |
---|---|
end number | End time of the range relative to the currentTime of the stream (in seconds) |
startnumber | Start 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.
Value | Description |
---|---|
N/A | No 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:
Value | Description |
---|---|
currentTime 8.19.0+ number | The position of the stream before the player seeks (in seconds) |
duration 8.19.0+ number | Duration of the current playlist item (in seconds) |
metadata object | Mutable properties defining the resource See: time.metadata |
position number | Playback position (in seconds) |
seekRange 8.19.0+ object | Time range representing how much video is available for seeking in DVR streams or for buffering in live streams See: time.seekRange |
type string | Identifies the event being listened for (time ) |
viewable boolean | If the player is viewable or not |
time.metadata
Value | Description |
---|---|
currentTime 8.19.0+ number | The position of the stream before the player seeks (in seconds) |
time.seekRange
Value | Description |
---|---|
end number | End time of the range relative to the currentTime of the stream (in seconds) |
startnumber | Start time of the range relative to the currentTime of the stream (in seconds) |