4 ms·
I hit this on https://ambiph.one https://ambiph.one - my solution ended up being similar (use an <audio> element) but because I also wanted audio to play in the
by matteason 2y ago
I hit this on https://ambiph.one https://ambiph.one - my solution ended up being similar (use an <audio> element) but because I also wanted audio to play in the background and when the screen is off there's an extra step of tricking Safari into thinking it's playing a livestream, since apparently that's the only kind of audio Apple thinks should be allowed to play in the background.
Coincidentally someone asked me about this the other day so I put together a minimal demo here in case it's useful to anyone: https://codepen.io/matteason/pen/VYwdzVV https://codepen.io/matteason/pen/VYwdzVV