Chrome 71 (December 2018) implements the new autoplay audio policy for the Web Audio API, which affects the Pico-8 web player. The BBS is OK because it implements a "curtain" that the user clicks on to start the player, which does the Web Audio enable interaction. But this breaks the exported web player as of Pico-8 0.1.11g: If I export a game to its own page then load the page, Pico-8 starts immediately and is disallowed sound. No interaction enables sound after this point.
One fix is for the exported web player to implement a curtain similar to the BBS. I don't know if that meets everyone's needs but would resolve the issue for the exported page. I assume we can work around this by implementing our own player curtain.
Interesting side note: This appears to affect stat() calls regarding sound as well. I have a cart that paused on stat(24) != 0, to wait for music to finish playing. The web export with sound disabled never gets past this point. I added a timeout for the pause to get around this, though I still don't have sound in this case.
This also needs to be investigated and tested with Safari 12. I don't use Safari regularly so I don't know how recently they implemented new autoplay policies. Various articles suggest they did it earlier, possibly last year with Safari 11. We're noticing a similar blocked audio behavior with HTML exports in Safari.
Demo with Santa Panic:
- Original export (no audio in Chrome 71): https://www.dansanderson.com/santapanic/santapanic_nosound.html
- Ultrabrite's template (audio works in Chrome 71): https://www.dansanderson.com/santapanic/santapanic.html
[Please log in to post a comment]