Interface: shakaExtern.AbrManager

An object which selects Streams for adaptive bit-rate presentations.
Implementations:
Source:

Methods

chooseStreams(streamSetsByTypenon-null) → (non-null) {Object.<string, shakaExtern.Stream>}

Chooses one Stream from each StreamSet to switch to. All StreamSets must be from the same Period. Some StreamSets may be absent in the case of language changes.
Parameters:
Name Type Description
streamSetsByType Object.<string, !shakaExtern.StreamSet>
Implementations:
Source:
Returns:
Type
Object.<string, shakaExtern.Stream>

disable()

Disables automatic Stream suggestions. After this, the AbrManager may not call switchCallback().
Implementations:
Source:

enable()

Enables automatic Stream choices from the last StreamSets passed to chooseStreams(). After this, the AbrManager may call switchCallback() at any time.
Implementations:
Source:

getBandwidthEstimate() → {number}

Gets an estimate of the current bandwidth in bit/sec. This is used by the Player to generate stats.
Implementations:
Source:
Returns:
Type
number

init(switchCallback)

Initializes the AbrManager.
Parameters:
Name Type Description
switchCallback shakaExtern.AbrManager.SwitchCallback
Implementations:
Source:

segmentDownloaded(startTimeMs, endTimeMs, numBytes)

Notifies the AbrManager that a segment has been downloaded (includes MP4 SIDX data, WebM Cues data, initialization segments, and media segments).
Parameters:
Name Type Description
startTimeMs number The wall-clock time, in milliseconds, when the request began (before any outbound request filters).
endTimeMs number The wall-clock time, in milliseconds, when the response ended (after all retries and inbound response filters).
numBytes number The total number of bytes transferred.
Implementations:
Source:

setDefaultEstimate(estimate)

Sets the default bandwidth estimate to use if there is not enough data.
Parameters:
Name Type Description
estimate number The default bandwidth estimate, in bit/sec.
Implementations:
Source:

stop()

Stops any background timers and frees any objects held by this instance. This will only be called after a call to init.
Implementations:
Source:

Type Definitions

SwitchCallback

A callback which implementations call to switch streams. The first argument is a map of content types to chosen streams. The second argument is an optional boolean. If true, all data will be from the buffer, which will result in a buffering event.
Type:
Source: