fix: improve resolution height extraction and matching in QualitySelector and PlayerDefaults - #34
Merged
Priveetee merged 4 commits intoSep 26, 2026
Conversation
Member
|
LGTM, thx a lot for ur contribution :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
QualitySelector(apps/web/src/components/quality-selector.tsx):optionHeight(option)that checksoption.quality?.height,option.height, and falls back toqualityLabelHeight(option.label).option.quality?.heightinqualityValue()andfilteredOptions.every(...)withoptionHeight(option).PlayerDefaults(apps/web/src/components/player-defaults.tsx):heightMatchto fall back toqualityLabelHeight(o.label)ifo.quality?.heightis not populated on the option's quality object.Why the change is needed
Depending on the underlying media provider (Vidstack native, DASH representations, or custom stream options), resolution height may be provided via
option.heightor encoded inoption.label(e.g."1080p","720p"), whileoption.quality?.heightmay be 0 or undefined.When this occurred:
filteredOptions.every((o) => (o.quality?.height ?? 0) === 0)evaluated totrue, causingQualitySelectorto returnnulland hide the quality selection menu entirely from the player controls.PlayerDefaults,heightMatchfailed to match user-configured default quality (e.g.1080p), preventing automatic quality elevation upon video load.Falling back to
option.heightandqualityLabelHeight(option.label)ensures resolution selection and auto-selection work reliably across all media stream types.Which issue it addresses
Relates to resolution selection and default quality matching for DASH streams in #287.
How it was tested
Whether another TypeType component must change with it
No other changes required.