Skip to content

fix(audio): mute toggle works on mobile (pause instead of setVolume)#167

Closed
sacha-l wants to merge 1 commit into
developfrom
fix/mobile-audio-mute
Closed

fix(audio): mute toggle works on mobile (pause instead of setVolume)#167
sacha-l wants to merge 1 commit into
developfrom
fix/mobile-audio-mute

Conversation

@sacha-l
Copy link
Copy Markdown
Collaborator

@sacha-l sacha-l commented May 23, 2026

Problem

The audio mute button doesn't work in production on mobile.

Cause

The toggle muted via widget.setVolume(0). On mobile — notably iOS — playback volume is hardware-controlled and setVolume is a no-op, so tapping "mute" left play() running at full volume and nothing actually muted.

Fix

Mute by pausing, unmute by playing (with setVolume(100) for desktop). play()/pause() honor the user's tap on every platform — and the tap is the user gesture mobile needs anyway. Persistence-across-pages and the finish→loop behavior are unchanged.

Test plan

  • cd client && npm run build — clean
  • cd client && npm run lint — clean (0 warnings)
  • Desktop (local dev): toggle flips Unmute→Mute (aria-pressed false→true), no console errors.
  • Mobile (real device): audio playback can't be verified headless — please confirm on an actual phone (mute should stop sound, unmute should start it).

Draft → develop. Since this is a prod bug, promote to main after merge to ship it.

The mute toggle relied on widget.setVolume(0), but volume is hardware-controlled
on mobile (notably iOS) where setVolume is a no-op — so tapping mute kept playing
at full volume. Mute now pauses and unmute plays (setVolume(100) on desktop);
play/pause honor the user's tap on every platform.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stadium Ready Ready Preview, Comment May 23, 2026 9:46am

@sacha-l
Copy link
Copy Markdown
Collaborator Author

sacha-l commented May 23, 2026

Superseded — rolled the mobile mute fix into the umbrella 'Minor bug fixes' PR #168 (same commit). Closing to avoid a duplicate.

@sacha-l sacha-l closed this May 23, 2026
@sacha-l sacha-l deleted the fix/mobile-audio-mute branch May 23, 2026 09:48
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.

1 participant