Constructor
new GapJumpingController(videonon-null, timelinenon-null, config, onEvent)
Parameters:
Name | Type | Description |
---|---|---|
video |
HTMLMediaElement | |
timeline |
shaka.media.PresentationTimeline | |
config |
shaka.extern.StreamingConfiguration | |
onEvent |
function | Called when an event is raised to be sent to the application. |
- Implements:
- Source:
Members
BROWSER_GAP_TOLERANCE
The limit, in seconds, for the gap size that we will assume the browser will
handle for us.
config_ :shaka.extern.StreamingConfiguration
Type:
eventManager_ :shaka.util.EventManager
Type:
gapJumpTimer_ :shaka.util.Timer
We can't trust |readyState| or 'waiting' events on all platforms. To make
up for this, we poll the current time. If we think we are in a gap, jump
out of it.
See: https://bit.ly/2McuXxm and https://bit.ly/2K5xmJO
Type:
onEvent_ :?function(!Event)
Type:
- ?function(!Event)
stallDetector_ :shaka.media.StallDetector
The stall detector tries to keep the playhead moving forward. It is
managed by the gap-jumping controller to avoid conflicts. On some
platforms, the stall detector is not wanted, so it may be null.
Type:
timeline_ :shaka.media.PresentationTimeline
Type:
video_ :HTMLMediaElement
Type:
Methods
createStallDetector_(mediaElementnon-null, config, onEvent) → {shaka.media.StallDetector}
Create and configure a stall detector using the player's streaming
configuration settings. If the player is configured to have no stall
detector, this will return |null|.
Parameters:
Name | Type | Description |
---|---|---|
mediaElement |
HTMLMediaElement | |
config |
shaka.extern.StreamingConfiguration | |
onEvent |
function(!Event) | Called when an event is raised to be sent to the application. |
Returns:
getGapsJumped() → {number}
Returns the total number of playback gaps jumped.
Returns:
- Type
- number
getStallsDetected() → {number}
Returns the number of playback stalls detected.
Returns:
- Type
- number
onPollGapJump_()
Called on a recurring timer to check for gaps in the media. This is also
called in a 'waiting' event.
onSegmentAppended()
Called when a segment is appended by StreamingEngine, but not when a clear
is pending. This means StreamingEngine will continue buffering forward from
what is buffered. So we know about any gaps before the start.
onStarted(startTime)
Called when playback has started and the video element is
listening for seeks.
Parameters:
Name | Type | Description |
---|---|---|
startTime |
number |
release()
Request that this object release all internal references.
- Implements:
- Source: