Remix.run Logo
▲ josephg 3 hours ago

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.

▲harrisi 2 hours ago | parent | next [-]

Largely not an LLM's work as far as I can tell: https://github.com/joshwcomeau/button-sounds

Also, here's the author's AI policy: https://www.joshwcomeau.com/ai-policy/

They're also a somewhat active user here.

▲ 3 hours ago | parent | prev | next [-]
[deleted]
▲hunter2_ 2 hours ago | parent | prev [-]

> 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.