So audio no longer works in games on puzzlescript.net and exported standalone files that aren't wrapped in a click barrier, because it sets up the audio context before the user clicks anything. And the user may not ever click anything, so there may never be sound!
I guess the approaches would be to:
Add a click-to-play screen at the start of the game and then either create the context or .resume() it after that
Run the game as normal but add a message that sound won't play until the user clicks, and add a handler on the first click that sets up the audio context if they ever do
Seems to be related to #419, except everywhere now
Just making an official ticket for this thing, oh boy.
Chrome now doesn't let Web Audio contexts make noises until the user "interacts" with the page (which seems to mean a click or touch): https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
So audio no longer works in games on puzzlescript.net and exported standalone files that aren't wrapped in a click barrier, because it sets up the audio context before the user clicks anything. And the user may not ever click anything, so there may never be sound!
I guess the approaches would be to:
Add a click-to-play screen at the start of the game and then either create the context or .resume() it after that
Run the game as normal but add a message that sound won't play until the user clicks, and add a handler on the first click that sets up the audio context if they ever do
Seems to be related to #419, except everywhere now