From 941fa9ad9c18d09fb08f3623b51e06a51a47e603 Mon Sep 17 00:00:00 2001 From: sacha <23283108+sacha-l@users.noreply.github.com> Date: Sat, 23 May 2026 11:46:22 +0200 Subject: [PATCH] fix(audio): mute by pausing so the toggle works on mobile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- client/src/components/audio/sound-cloud-audio.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/src/components/audio/sound-cloud-audio.tsx b/client/src/components/audio/sound-cloud-audio.tsx index f41625e..edd8f24 100644 --- a/client/src/components/audio/sound-cloud-audio.tsx +++ b/client/src/components/audio/sound-cloud-audio.tsx @@ -153,8 +153,16 @@ export function SoundCloudAudioProvider({ children }: { children: React.ReactNod const next = !prev; const widget = widgetRef.current; if (widget) { - widget.setVolume(next ? 0 : 100); - widget.play(); + // Mute by pausing, not by setVolume(0): on mobile (notably iOS) volume is + // hardware-controlled and setVolume is a no-op, so volume-based muting + // silently failed there. play()/pause() honor the user's tap on every + // platform — and the tap is the gesture mobile needs to start audio. + if (next) { + widget.pause(); + } else { + widget.setVolume(100); + widget.play(); + } } return next; });