Constructor
new GapJumpingController(videonon-null, timelinenon-null, config, 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 | |
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
Type:
(private) hadSegmentAppended_ :boolean
Type:
- boolean
(private, nullable) onEvent_ :?function(!Event)
Type:
- ?function(!Event)
(private) seekingEventReceived_ :boolean
Type:
- boolean
(private) stallCorrected_ :boolean
True if we have already flushed the pipeline at stallPlayheadTime_.
Allows us to avoid flushing multiple times for the same stall.
Type:
- boolean
(private) stallPlayheadTime_ :number
The playhead time where we think a stall occurred. When the ready state
says we don't have enough data and the playhead stops too long, we assume
we have stalled.
Type:
- number
(private) stallWallTime_ :number
The wall-clock time (in milliseconds) that the stall occurred. This is
used to ensure we don't flush the pipeline too often.
Type:
- number
(private, nullable) timeline_ :shaka.media.PresentationTimeline
Type:
(private) video_ :HTMLMediaElement
Type:
Methods
(export) destroy() → (non-null) {Promise}
Request that this object be destroyed, releasing all resources and shutting
down all operations. Returns a Promise which is resolved when destruction
is complete. This Promise should never be rejected.
- Implements:
- Source:
Returns:
- Type
- Promise
(private) handleStall_()
This determines if we are stalled inside a buffered range and corrects it if
possible.
(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.