Repository navigation
feat: show HDR badge next to video title - #4412
Merged
Merged
Conversation
Member
|
Hi and thank you! @wolfdate25 why switch manually back and forth? did you see our old feature "Avoid HDR, keep SDR" ? |
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
Shows a small
HDRbadge next to the video title on watch pages when the current video offers HDR streams — even while Windows/Firefox is in SDR mode, so users can decide to switch the OS to HDR before watching.Why
Firefox 153+ plays YouTube HDR only when Windows itself is in HDR mode. Users who normally stay in SDR have no way to tell an HDR video apart until they switch modes and check the quality menu.
How it works
#movie_player.getPlayerResponse()), falls back towindow.ytInitialPlayerResponse; watch-page fetch deliberately avoided.HDRin qualityLabel, or VP9 Profile 2 codec string.videoDetails.videoIdvs URLv=) so SPA navigation can't show a stale badge; retries a few times because the player response populates asynchronously.ytd-watch-metadata #title, cleared on every navigation, and gated behind a new Appearance switch (hdr_badge, default off).Files
js&css/web-accessible/www.youtube.com/appearance.js—ImprovedTube.hdrBadge()js&css/web-accessible/functions.js— hook intovideoPageUpdate()menu/skeleton-parts/appearance.js+_locales/en/messages.json— setting + labeljs&css/extension/www.youtube.com/appearance/details/details.css— badge styletests/unit/hdr-badge.test.js— 9 tests (PQ, HLG, primaries, label, vp9.2, SDR-negative, setting-off, stale-response, non-video page)Verification
npm test: 31 suites / 156 tests pass (147 pre-existing + 9 new)web-ext lint: no new issues (single error is a pre-existing invalid JSON intests/csslint_rules.json, also present on clean master)LXb3EKWsInQ): detection hitSMPTEST2084and the badge rendered next to the title.