How to stop hls.js from switching video quality too often on mobile networks
Developers using hls.js can experience 'ABR flapping,' where a video player rapidly oscillates between quality levels on unstable cellular connections, degrading the viewing experience despite low rebuffering. The root cause is the player's bandwidth estimator reacting too aggressively to noisy, spike-prone mobile throughput data. A fix involves tuning several hls.js configuration parameters — including the newly introduced abrSwitchInterval in version 1.7 — to slow down quality switches and make upswitches harder to trigger. Engineers can also attach a monitoring function that tracks LEVEL_SWITCHED events to measure switches per minute and detect reversal patterns before and after applying the configuration. The recommended approach is to widen the bandwidth estimator's memory window, reduce upswitch sensitivity, and compare flap metrics against a baseline to avoid over-correcting into unnecessary rebuffering.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in