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.
Also, here's the author's AI policy: https://www.joshwcomeau.com/ai-policy/
They're also a somewhat active user here.
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
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.
I would find it frustrating if my phone was set to silent and it played button noises on a website.
However, a bunch of 3rd-party apps misinterpreted the meaning of this signal, so for example, a number of popular games mute all of their audio when the silent switch is enabled, meaning I have to un-silence the ringer just to hear game audio.
RE: your solution - For iPhones with action buttons, can disable silent mode in control center.