Skip to content

fix: remove duplicate playback speed button code and settings#4166

Open
hkzo wants to merge 1 commit into
code-charity:masterfrom
hkzo:fix/playback-speed-button-duplicates
Open

fix: remove duplicate playback speed button code and settings#4166
hkzo wants to merge 1 commit into
code-charity:masterfrom
hkzo:fix/playback-speed-button-duplicates

Conversation

@hkzo

@hkzo hkzo commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Closes #3823

Summary

This PR removes the duplicate, overridden ImprovedTube.playerPlaybackSpeedButton
implementation and cleans up the redundant Playback Speed Button settings entry.

The active runtime implementation is left unchanged to minimize user-facing behavior changes.

Changes

  • Remove the earlier overwritten playerPlaybackSpeedButton implementation from
    js&css/web-accessible/www.youtube.com/player.js.
  • Retain the Player > Buttons > Playback speed button settings entry.
  • Remove the duplicate Player > Extra buttons inside the player > Playback Speed Button settings entry.
  • Remove the non-rendered player_custom_playback_speed slider definition from
    the Buttons settings entry.
  • Move existing localized player_playback_speed_button strings to
    playbackSpeedButton where needed, then remove the now-unused
    player_playback_speed_button locale entries.

Why

ImprovedTube.playerPlaybackSpeedButton was defined twice in player.js.
Because the later assignment overwrites the earlier one, only the later
implementation is active at runtime.

The related setting was also exposed in two places:

  • Player > Buttons > Playback speed button
  • Player > Extra buttons inside the player > Playback Speed Button

Both settings entries controlled the same player_playback_speed_button storage key.
The active player button is inserted into the left controls, so this PR keeps
the Player > Buttons entry and removes the duplicate "Extra buttons inside the player" entry.

Notes

The removed player_custom_playback_speed slider definition was not rendered by
the current satus.render settings renderer, so it was not a functional settings control.
Smart Speed still reads player_custom_playback_speed as its fallback/base
playback speed if that value already exists in storage. Since there was no
currently working UI for creating or editing that Smart Speed-referenced value,
removing this non-rendered slider definition does not change any editable settings UI.

This PR also does not change the active Playback Speed Button behavior. The
active implementation continues to use the existing player_playback_speed
setting for left-click speed and shortcuts_playback_speed_step for wheel adjustments.

Since the remaining settings entry uses the playbackSpeedButton locale key,
the unused player_playback_speed_button locale key can also be removed. For
locales that only had player_playback_speed_button (de, es, and fr),
the existing translated message was moved to playbackSpeedButton first.

Testing

  • node --check js&css/web-accessible/www.youtube.com/player.js
  • node --check menu/skeleton-parts/player.js
  • Validate changed _locales/*/messages.json files with JSON.parse.
  • git diff --check
  • grep -nE 'playerPlaybackSpeedButton = function|player_playback_speed_button:|children:[[:space:]]*\[|player_custom_playback_speed' "js&css/web-accessible/www.youtube.com/player.js" menu/skeleton-parts/player.js

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.

💡playerPlaybackSpeedButton defined twice in player.js

1 participant