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:
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) |
start number | 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 | Type |
---|---|---|
- | 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:
Value | Description | Type |
---|---|---|
duration | Duration of the current playlist item in seconds. | Number |
position | Playback position in seconds. | Number |
viewable | If the player is viewable or not. | Number |