Skip to content

fix(player): handle mute state explicitly in volume control#3211

Merged
ImprovedTube merged 1 commit intocode-charity:masterfrom
rajanarahul93:fix/volume-muting-bug
Oct 1, 2025
Merged

fix(player): handle mute state explicitly in volume control#3211
ImprovedTube merged 1 commit intocode-charity:masterfrom
rajanarahul93:fix/volume-muting-bug

Conversation

@rajanarahul93
Copy link
Contributor

fix(player): Correctly handle mute state in forced volume

Summary

This pull request fixes a bug where setting the player volume to 0% via the "Forced Volume" feature would not mute the audio. The patch ensures that the player's mute state is always synchronized with the volume level, restoring native player behavior.

Root Cause

The playerVolume function directly manipulated the volume level but did not manage the player's separate isMuted state. When the volume was set to 0, the player.mute() method was never called, which could leave audio playing.

Changes

  • js&css/web-accessible/www.youtube.com/player.js: Modified the playerVolume function to explicitly call player.mute() when the target volume is 0 and player.unMute() when it is greater than 0.

Screenshots

These screenshots demonstrate the fix is working correctly with the "Forced Volume" feature enabled.

Player Muted at 0% Volume

Shows the player UI correctly displaying a muted state when the volume is set to 0. The audio was confirmed to be silent during testing.

image

Player at 100% Volume

Shows the player UI correctly displaying full volume, which was confirmed to be working as expected.

image

Testing

  • Performed manual verification:
    • Enabled the "Forced Volume" setting.
    • Lowered the volume to 0% and confirmed the audio became completely silent.
    • Raised the volume from 0% and confirmed the audio became audible and scaled correctly up to 100%.

Risk & Rollback

  • Risk: Low. The change is a targeted bug fix to restore expected behavior and does not affect other features.
  • Rollback: The commit can be safely reverted using git revert <commit_hash>.

Related

@ImprovedTube
Copy link
Member

hi again and thank you! @rajanarahul93
looks good!
( not sure what #3205 meant )

@ImprovedTube ImprovedTube merged commit 7b18e02 into code-charity:master Oct 1, 2025
1 check passed
@rajanarahul93
Copy link
Contributor Author

@ImprovedTube is there any change I should make ?

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.

🐞Volume not muting when reaching 0 using arrows and volume didn't reach 100%

2 participants