Class: shaka.abr.SlidingPercentileBandwidthEstimator

This class tracks bandwidth samples and estimates available bandwidth. Based on the minimum of two exponentially-weighted moving averages with different half-lives.

Constructor

new SlidingPercentileBandwidthEstimator()

This class tracks bandwidth samples and estimates available bandwidth. Based on the minimum of two exponentially-weighted moving averages with different half-lives.

Source:

Members

BYTES_TRANSFERRED_FOR_ESTIMATE :number

Type:
  • number
Source:

DEFAULT_SLIDING_WINDOW_MAX_WEIGHT :number

Type:
  • number
Source:

ELAPSED_MILLIS_FOR_ESTIMATE :number

Type:
  • number
Source:

bandwidthEstimate_

* @private {number}
Source:

totalBytesTransferred_ :number

Number of bytes sampled.
Type:
  • number
Source:

totalTimeElapsed_ :number

Number of bytes sampled.
Type:
  • number
Source:

Methods

getBandwidthEstimate(defaultEstimate) → {number}

Gets the current bandwidth estimate.
Parameters:
Name Type Description
defaultEstimate number
Source:
Returns:
The bandwidth estimate in bits per second.
Type
number

hasGoodEstimate() → {boolean}

Source:
Returns:
True if there is enough data to produce a meaningful estimate.
Type
boolean

sample(durationMs, numBytes)

Takes a bandwidth sample.
Parameters:
Name Type Description
durationMs number The amount of time, in milliseconds, for a particular request.
numBytes number The total number of bytes transferred in that request.
Source: