Constructor
new SimpleLLAbrManager()
This defines the default Low Latency ABR manager for the Player
- Implements:
- Source:
Members
bufferingTimeToDecreaseBitrate_ :number
Type:
- number
- Source:
consecutiveFailedIncreaseVideoBitrateCount_ :number
Type:
- number
- Source:
lastTimeChosenMs_ :number
The last wall-clock time, in milliseconds, when streams were chosen.
Type:
- number
- Source:
processedUris_ :Array.<string>
Type:
- Array.<string>
- Source:
processedUriSet_ :Set.<string>
Type:
- Set.<string>
- Source:
variants_ :Array.<!shaka.extern.Variant>
A filtered list of Variants to choose from.
Type:
- Array.<!shaka.extern.Variant>
- Source:
Methods
filterAndSortVariants_(restrictionsnullable, variantsnon-null) → {Array.<shaka.extern.Variant>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
restrictions |
shaka.extern.Restrictions |
<nullable> |
|
variants |
Array.<shaka.extern.Variant> |
- Source:
Returns:
variants filtered according to
|restrictions| and sorted in ascending order of bandwidth.
- Type
- Array.<shaka.extern.Variant>
chooseNextHigherBandwidthVariant_(sortedVariantsnon-null)
Find the first variant that greater than current bitrate
Parameters:
Name | Type | Description |
---|---|---|
sortedVariants |
Array.<shaka.extern.Variant> |
- Source:
chooseNextLowerBandwidthVariant_(sortedVariantsnon-null)
Find the first variant that smaller than current bitrate
Parameters:
Name | Type | Description |
---|---|---|
sortedVariants |
Array.<shaka.extern.Variant> |
- Source:
chooseVariant() → {shaka.extern.Variant}
Chooses one variant to switch to. Called by the Player.
- Implements:
- Source:
Returns:
- Type
- shaka.extern.Variant
chooseVariantByBandwidth_(sortedVariantsnon-null)
Parameters:
Name | Type | Description |
---|---|---|
sortedVariants |
Array.<shaka.extern.Variant> |
- Source:
configure(config)
Sets the ABR configuration.
It is the responsibility of the AbrManager implementation to implement the
restrictions behavior described in shaka.extern.AbrConfiguration.
Parameters:
Name | Type | Description |
---|---|---|
config |
shaka.extern.AbrConfiguration |
- Implements:
- Source:
decreaseVideoBitrate_()
- Source:
disable()
Disables automatic Stream suggestions. After this, the AbrManager may not
call switchCallback().
- Implements:
- Source:
enable()
Enables automatic Variant choices from the last ones passed to setVariants.
After this, the AbrManager may call switchCallback() at any time.
- Implements:
- Source:
getBandwidthEstimate() → {number}
Gets an estimate of the current bandwidth in bit/sec. This is used by the
Player to generate stats.
- Implements:
- Source:
Returns:
- Type
- number
getDefaultBandwidth_()
- Source:
getIncreaseVideoBitrateDelay() → {number}
- Source:
Returns:
- Type
- number
getProcessedUri(index) → {string}
Parameters:
Name | Type | Description |
---|---|---|
index |
number |
- Source:
Returns:
- Type
- string
getProcessedUriCount() → {number}
- Source:
Returns:
- Type
- number
increaseVideoBitrate_()
- Source:
init(switchCallback)
Initializes the AbrManager.
Parameters:
Name | Type | Description |
---|---|---|
switchCallback |
shaka.extern.AbrManager.SwitchCallback |
- Implements:
- Source:
onBuffering()
Called when enter buffering state
- Implements:
- Source:
onBufferingEnd()
Called when exit buffering state
- Implements:
- Source:
playbackRateChanged(rate)
Updates manager playback rate.
Parameters:
Name | Type | Description |
---|---|---|
rate |
number |
- Implements:
- Source:
resetStallCount_()
- Source:
scheduleIncreaseVideoBitrate_()
- Source:
scheduleResetStallCount_()
- Source:
scheduleSuggestStream_()
- Source:
segmentDownloadCompleted(deltaTimeMs, numBytes, urisnon-null, isFullSpeed)
Notifies the AbrManager that a segment download has been completed
(includes MP4 SIDX data, WebM Cues data, initialization segments,
and media segments).
Parameters:
Name | Type | Description |
---|---|---|
deltaTimeMs |
number | The duration, in milliseconds, that the request took to complete. |
numBytes |
number | The total number of bytes transferred. |
uris |
Array.<string> | |
isFullSpeed |
boolean |
- Implements:
- Source:
segmentDownloaded(deltaTimeMs, numBytes, uri)
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 |
---|---|---|
deltaTimeMs |
number | The duration, in milliseconds, that the request took to complete. |
numBytes |
number | The total number of bytes transferred. |
uri |
string |
- Implements:
- Source:
setPlayerInterface(playerInterfacenullable)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
playerInterface |
shaka.abr.SimpleLLAbrManager.PlayerInterface |
<nullable> |
- Source:
setVariants(variantsnon-null)
Updates manager's variants collection.
Parameters:
Name | Type | Description |
---|---|---|
variants |
Array.<!shaka.extern.Variant> |
- Implements:
- Source:
stop()
Stops any background timers and frees any objects held by this instance.
This will only be called after a call to init.
- Implements:
- Source:
suggestStreams_()
Calls switch_() with the variant chosen by chooseVariant().
- Source:
Type Definitions
PlayerInterface
Type:
- {getPresentationLatencyInfo: (function(): shaka.media.StreamingEngine.PresentationLatencyInfo|null), getServiceDescription: (function(): shaka.extern.ServiceDescription|undefined)}
- Source: