←back to thread

292 points nexo-v1 | 1 comments | | HN request time: 0s | source
Show context
mg ◴[] No.44063073[source]
I wonder if one could build this in HTML, so there is no need to install anything.

On both iOS and Android, HTML can play videos and mp3s while the screen is turned off. So maybe it is possible?

replies(4): >>44063123 #>>44063233 #>>44063377 #>>44065828 #
matteason ◴[] No.44063377[source]
It's actually surprisingly hard to get iOS Safari to keep playing audio with the screen off.

When I made https://ambiph.one I ended up having to route everything through a MediaStreamAudioDestinationNode to trick Safari into thinking it's a livestream, which is apparently the only type of audio allowed to play in the background

Minimal demo here if it's helpful for anyone: https://codepen.io/matteason/pen/VYwdzVV

replies(2): >>44063554 #>>44063668 #
egglemonsoup ◴[] No.44063554[source]
Hey Matt! I've been a fan of Ambiphone for a while and I see your comments on HN surprisingly often. I've been trying to build a different web audio player with inspiration taken from yours. I haven't figured out the screen off audio thing, so thank you so much for sharing this demo!!!
replies(1): >>44064565 #
1. matteason ◴[] No.44064565[source]
Thanks so much, that's really cool to hear! Let me know if you ever hit any more problems, I've been meaning to blog about a bunch of problems I had to work round in various browsers but haven't got round to it yet, so happy to answer any questions