current: rebuffering
future: rebuffering + dropped frames
current: bitrate + resolution
future: bitrate + resolution + framerate + quality score + codec
avoid exceeding width and height of player
Algorithm | systemBandwidth Value | Low Water Line | High Water Line | When is it run? |
---|---|---|---|---|
default | most recent | 0-30s (dynamic) | N/A | bandwidthupdate events2 |
experimentalBufferBasedABR | moving average1 | 0-16s (dynamic) | 30s | timer (250ms)3 |
1 decay of 0.55: average = 0.55 * systemBandwidth
+ (1 - 0.55) * average
2 bandwidthupdate
events occur on the following
- XHR
progress
events (~250ms) - XHR timeout
- source buffer
updateend
events
3 decay does not run on the timer
- Dynamic
GOAL_BUFFER_LENGTH
of 30-60s: buffer occupancy at which to stop buffering - Use of simpleSelector
- Use of
Config.BUFFER_LOW_WATER_LINE
: buffer occupancy before allowing upswitches - Use of shouldSwitchToMedia
- if live: don't consider low water line
- if LL-HLS: don't switch before playback starts
MIN_SEGMENT_DURATION_TO_SAVE_STATS = 1 / 60
Config.BUFFER_LOW_WATER_LINE
valuesexperimentalBufferBasedABR
usesConfig.BUFFER_HIGH_WATER_LINE
: buffer occupancy before disallowing downswitchesexperimentalBufferBasedABR
uses a moving average instead of most recent valuedefault
uses earlyAbortWhenNeeded on XHRprogress
events
bandwidth
- uses NetworkInformation.downlink (max 10 Mbps) if available
- otherwise (or if over 10 Mbps) uses XHR bits / time taken
- timeout means bandwidth goes to 1
throughput
- decryption + transmuxing + appending
- cumulative moving average: new = old + (sample - old) / (sample count + 1)
systemBandwidth
= 1 / (1 / bandwidth + 1 / throughput)
- simpleSelector: basic function for choosing based on bandwidth, resolution, and player dimensions
- lastBandwidthSelector: default
- movingAverageBandwidthSelector: used by
experimentalBufferBasedABR
with 0.55 decay - minRebufferMaxBandwidthSelector:
earlyAbortWhenNeeded
comparison - lowestBitrateCompatibleVariantSelector: for
enableLowInitialPlaylist
option
- dropped frames
- segment size
- quality score (e.g., VMAF)
- codec comparison
- framerates