Class: shaka.media.GapJumpingController

Constructor

new GapJumpingController(videonon-null, timelinenon-null, config, onEvent, getPlaybackRateopt, getSkipRanges)

Parameters:
Name Type Attributes 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.
getPlaybackRate function <optional>
Returns the current playback rate. A negative value means the content is being played in reverse (during reverse trick play the media element's playbackRate is 0, so this is the only source of direction).
getSkipRanges function Returns the active skip ranges (see shaka.Player#addSkipRange). A gap created by one is jumped only once the playhead reaches its edge, so no content leading into the range is skipped.
Implements:
Source:

Members

BROWSER_GAP_TOLERANCE

The limit, in seconds, for the gap size that we will assume the browser will handle for us.
Source:

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:
Source:

gapsJumped_ :number

Type:
  • number
Source:

getPlaybackRate_ :function(): number

Type:
  • function(): number
Source:

getSkipRanges_ :function(): !Array<{start: number, end: number}>

Type:
  • function(): !Array<{start: number, end: number}>
Source:

hadSegmentAppended_ :boolean

Type:
  • boolean
Source:

isJumpingGap_ :boolean

Type:
  • boolean
Source:

onEvent_ :?function(!Event)

Type:
  • ?function(!Event)
Source:

seekingEventReceived_ :boolean

Type:
  • boolean
Source:

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:
Source:

stallsDetected_ :number

Type:
  • number
Source:

started_ :boolean

Type:
  • boolean
Source:

startTime_ :number

Type:
  • number
Source:

Methods

createStallDetector_() → {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|.
Source:
Returns:
Type
shaka.media.StallDetector

getGapsJumped() → {number}

Returns the total number of playback gaps jumped.
Source:
Returns:
Type
number

getIsJumpingGap() → {boolean}

Returns whether the player is currently jumping a gap.
Source:
Returns:
Type
boolean

getStallsDetected() → {number}

Returns the number of playback stalls detected.
Source:
Returns:
Type
number

onPollGapJump_()

Called on a recurring timer to check for gaps in the media. This is also called in a 'waiting' event.
Source:

onSeeking()

Called when a seek has started.
Source:

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.
Source:

onStarted(startTime)

Called when playback has started and the video element is listening for seeks.
Parameters:
Name Type Description
startTime number
Source:

release()

Request that this object release all internal references.
Implements:
Source:

seek_(time)

Seek to a specific time in the video.
Parameters:
Name Type Description
time number The time to seek to, in seconds.
Source: