hi all, i am a designer with limited coding skills. i built an environment with sound but it does not play when embedded on my website. sometimes it works for me on chrome and safari but i had friends test it on chrome on desktop and it did not work for them - does it work for you? it does not work on mobile either but i think that is not possible. i tried to trouble shoot it myself based on stack overflow but could not fix it. i would be so grateful for your help in fixing this.
Welcome to the world of web audio which is a bit annoying,
For some browser and enviorments bandwith may be limited so browsers tried to save bandwith by blocking audio playing audio. This happens almost always on mobile and depends on your settings on desktop. You can however play audio with a user gesture. A user gesture is something like the user presses a button, but I don’t think it includes keypresses. It’s actually a bit more complicated than I can describe…see the resources below.
Here are some resources you should take a look at(first one has memes :D)
and here’s where I first ran into this darn problem
and for those wondering yes this applies to video even more. YouTube in many cases has a high media score or something so it can autoplay videos.
Offtopic text:
disabling autoplay shall bring the rickrolling numbers down…but youtube.com launches mobile youtube for rickrolls anyway.
that was when I was doing predecessors of OpenRadio. One of the reasons OpenRadio has infinite streams is because sometimes you can’t automatically play the next song by loading a new audio element.
i’m working on another “youtube music” application and by enslaving youtube embeds i’m sure it’ll be foolproof at least for a while