Audio not playing on mobile
Version
v2000.1
What browsers are you seeing the problem on?
Chrome, Firefox, Safari, Microsoft Edge, Other
What happened?
Nothing plays
What's the expected behavior?
There should be some sounds
Minimum reproducable code
kaboom()
burp()
Live demo
https://kaboomjs.com/play?demo=burp
Is there an existing issue for this?
- [X] I've searched and there is no existing issue for this bug
Kaboom audio sounds definitely play on mobile (very well too!), check out this example: https://replit.com/@jwsy/avocado-remix - hosted at https://avocado-remix.jwsy.repl.co/
The way I get this to work is to play a howler sound first that ??? which causes all the other sounds to play. I imagine this has something to do with how mobile browsers require a click event to play and perhaps Kaboom isn't registering the touch events as click events.
L17 - creates the Howl obj
L337 - plays the sound in the "main" start scene - but this doesn't work if replace this line with a kaboom play sound callconst o = play("o"...)
Interesting, sounds like howler helped kaboom to properly initiate some audio context required to play audio on mobile. I'll take a closer look tomorrow.