You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: "Auto" quality option is missing from the player quality menu, and auto quality wrongly selects 4K on mobile devices #407
When configuring playback quality, I noticed two related issues regarding "Auto" quality:
"Auto" option is missing in the player menu:
In the on-screen player quality selector (QualitySelector), only fixed resolution tiers (2160p, 1440p, 1080p, 720p, etc.) are available. There is no "Auto" option to allow the player to adaptively select resolution on the fly.
"Auto" default setting incorrectly resolves to 4K on mobile phones:
When setting default quality to "Auto" in Playback Settings, the player immediately pulls 4K (2160p) on a mobile phone (e.g. iPhone).
Steps to reproduce
In Settings -> Playback, set the default video quality to "Auto".
Open any video on a mobile phone (e.g. an iPhone with devicePixelRatio = 3).
Observe that the player loads the 4K (2160p) stream, causing high bandwidth consumption and device heating.
Open the in-player quality menu: notice there is no "Auto" option available to re-enable adaptive switching.
Area
Frontend (web app)
Channel
beta
Anything else?
Root Cause Analysis
"Auto" explicitly filtered out in QualitySelector:
In apps/web/src/components/quality-selector.tsx:
For standard/Vidstack streams, line 36 explicitly skips the auto option:
for(constoptionofoptions){if(option.quality===null)continue;// Vidstack's Auto option has quality === null
For SABR streams, sabrResolutionOptions only maps concrete format itags without providing an "Auto" selection entry.
Screen height calculation bug in automaticSabrQuality:
In apps/web/src/lib/sabr-source.ts:
On a mobile phone in portrait orientation (e.g. iPhone with screen height 844 pt and DPR 3):
physicalHeight evaluates to 844 * 3 = 2532px.
Since 2160 <= 2532, the algorithm picks 2160p (4K).
For standard 16:9 landscape videos on phones, the limiting resolution is the screen width (Math.min(screenWidth, screenHeight) * DPR ≈ 1170px), which should cap at 1080p rather than 4K.
Proposed Fix
Provide "Auto" in QualitySelector: Keep the Auto option in collectResolutionOptions and add an Auto option for SABR playback so users can switch back to adaptive mode from the player menu.
Fix automaticSabrQuality mobile dimension: Use Math.min(window.screen.width, window.screen.height) * devicePixelRatio (or explicitly cap mobile phone viewports at 1080p/1440p) so phones do not inadvertently select 4K.
Activity