RoyalUr.net icon indicating copy to clipboard operation
RoyalUr.net copied to clipboard

Fix sound playback on mobile

Open Sothatsit opened this issue 3 years ago • 1 comments

The mobile client has a lot of issues with audio due to the browser requiring user interaction events to play sounds.

I think there is a workaround for this however. It seems that each interaction allows you to play one Audio object as many times as you like! Therefore, I am thinking that on each interaction with the browser we could add to a pool of Audio objects to use to play audio on mobile. Whenever we need to play a sound, we can then swap the src of these Audio objects to the sound we want to play, and play the sound!

Sothatsit avatar May 10 '21 10:05 Sothatsit

We could also consider using a pre-existing solution such as Howler.js.

Sothatsit avatar Apr 18 '22 01:04 Sothatsit