Lurker News

Comments (51) 34 threads

Show all comments

Showing thread 3 of 34

masenf3 replies#
> Frustratingly, browsers can decide to block a website from playing any sound. iOS Safari seems particularly strict about this. So, if you’re not hearing a click sound when tapping the big red button, please check out this website on a desktop computer.

While I understand this behavior from Apple in a user-first perspective and do find audio on mobile web to be annoying in most cases, an easy way to allow audio to play on an iPhone that isn't "use a desktop" seems to be flipping the hardware switch to turn off silent mode.
I'm not proud to admit it took 5 minutes of poking and a Google/Gemini search to figure that out...

Barbing#
Dev should be able to work around it though a minimum one user tap on page should be required, IIRC.

RE: your solution - For iPhones with action buttons, can disable silent mode in control center.

al_borland#
Having audio in the browser respect the silent mode switch seems perfectly reasonable.

I would find it frustrating if my phone was set to silent and it played button noises on a website.

josephg3 replies#
The general rule is that audio in a tab on ios is banned until a user initiated event (eg a play button) plays audio. After that, audio works.

After a lot of trial and error, I've taken to putting a button on any page I make that uses audio with the label "Click here to unmute". Have it play a silent audio clip when it's pressed. After that, audio works.
The UI on this page should work fine on ios if the big red play button simply plays audio directly via webaudio. Who knows how it's actually coded though. It looks like an LLM's work. Probably a mess.

hunter2_#
> I've taken to putting a button on any page I make that uses audio with the label "Click here to unmute". Have it play a silent audio clip when it's pressed. After that, audio works.

So anyone who wants to defy the reason for this limitation simply needs to lead the visitor to click something that doesn't reload the page? Instead of "unmute," maybe a throbbing "next" arrow or any innocuous link such as a menu item...
I wonder if some set of navigation-like things, such as doing a history.pushState() to change the address bar, cancels what this trick would otherwise achieve.

jimmySixDOF#
>After that, audio works.

untill you get stuck in some CORS permissions nightmare like try to click through a link or expose iFrames etc this is as much W3C as it is Apple also big blocker for immersive web (webxr) permissioning just gets in the way