Skip to content
This repository was archived by the owner on Nov 12, 2024. It is now read-only.

Audio not playing on mobile #476

Open
1 task done
slmjkdbtl opened this issue Jan 6, 2022 · 2 comments
Open
1 task done

Audio not playing on mobile #476

slmjkdbtl opened this issue Jan 6, 2022 · 2 comments

Comments

@slmjkdbtl
Copy link
Contributor

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?

  • I've searched and there is no existing issue for this bug
@jwsy
Copy link

jwsy commented Feb 16, 2022

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"...)

@slmjkdbtl
Copy link
Contributor Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants