Constructor
new GapJumpingController(videonon-null, timelinenon-null, config, stallDetector, onEvent)
Creates a new GapJumpingController that handles jumping gaps that appear
within the content. This will only jump gaps between two buffered ranges,
so we should not have to worry about the availability window.
Parameters:
Name | Type | Description |
---|---|---|
video |
HTMLMediaElement | |
timeline |
shaka.media.PresentationTimeline | |
config |
shaka.extern.StreamingConfiguration | |
stallDetector |
shaka.media.StallDetector | The stall detector is used to keep the playhead moving while in a playable region. The gap jumping controller takes ownership over the stall detector. If no stall detection logic is desired, |null| may be provided. |
onEvent |
function(!Event) | Called when an event is raised to be sent to the application. |
- Implements:
- Source:
Members
(static, constant) BROWSER_GAP_TOLERANCE
The limit, in seconds, for the gap size that we will assume the browser will
handle for us.
(private, nullable) config_ :shaka.extern.StreamingConfiguration
Type:
(private) didFireLargeGap_ :boolean
Type:
- boolean
(private) eventManager_ :shaka.util.EventManager
Type:
(private, nullable) 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:
(private) hadSegmentAppended_ :boolean
Type:
- boolean
(private, nullable) onEvent_ :?function(!Event)
Type:
- ?function(!Event)
(private) seekingEventReceived_ :boolean
Type:
- boolean
(private) 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:
(private, nullable) timeline_ :shaka.media.PresentationTimeline
Type:
(private) video_ :HTMLMediaElement
Type:
Methods
(private) 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.
(export) release()
Request that this object release all internal references.
- Implements:
- Source: