Skip to content

fix: improve resolution height extraction and matching in QualitySelector and PlayerDefaults - #34

Merged
Priveetee merged 4 commits into
TypeType-Video:devfrom
Aquarius-Situla:fix/player-quality-resolution-matching
Sep 26, 2026
Merged

Priveetee merged 4 commits into
TypeType-Video:devfrom
Aquarius-Situla:fix/player-quality-resolution-matching

Conversation

@Aquarius-Situla

Copy link
Copy Markdown
Contributor

What changed

  • In QualitySelector (apps/web/src/components/quality-selector.tsx):
    • Added helper optionHeight(option) that checks option.quality?.height, option.height, and falls back to qualityLabelHeight(option.label).
    • Replaced strict option.quality?.height in qualityValue() and filteredOptions.every(...) with optionHeight(option).
  • In PlayerDefaults (apps/web/src/components/player-defaults.tsx):
    • Allowed heightMatch to fall back to qualityLabelHeight(o.label) if o.quality?.height is 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.height or encoded in option.label (e.g. "1080p", "720p"), while option.quality?.height may be 0 or undefined.

When this occurred:

  1. filteredOptions.every((o) => (o.quality?.height ?? 0) === 0) evaluated to true, causing QualitySelector to return null and hide the quality selection menu entirely from the player controls.
  2. In PlayerDefaults, heightMatch failed to match user-configured default quality (e.g. 1080p), preventing automatic quality elevation upon video load.

Falling back to option.height and qualityLabelHeight(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

  • Verified on self-hosted instances with multi-resolution DASH streams; confirmed that the quality menu reliably appears with available resolutions and that default resolution preferences (such as 1080p) are selected automatically on load.

Whether another TypeType component must change with it

No other changes required.

@Priveetee

Copy link
Copy Markdown
Member

LGTM, thx a lot for ur contribution :)

@Priveetee
Priveetee merged commit 8f83a0f into TypeType-Video:dev Sep 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants