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.
Members
BYTES_TRANSFERRED_FOR_ESTIMATE :number
Type:
- number
DEFAULT_SLIDING_WINDOW_MAX_WEIGHT :number
Type:
- number
ELAPSED_MILLIS_FOR_ESTIMATE :number
Type:
- number
bandwidthEstimate_
* @private {number}
slidingPercentile_ :shaka.abr.SlidingPercentile
Type:
totalBytesTransferred_ :number
Number of bytes sampled.
Type:
- number
totalTimeElapsed_ :number
Number of bytes sampled.
Type:
- number
Methods
getBandwidthEstimate(defaultEstimate) → {number}
Gets the current bandwidth estimate.
Parameters:
Name | Type | Description |
---|---|---|
defaultEstimate |
number |
Returns:
The bandwidth estimate in bits per second.
- Type
- number
hasGoodEstimate() → {boolean}
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. |