phaser icon indicating copy to clipboard operation
phaser copied to clipboard

Unlock html audio one time

Open rexrainbow opened this issue 1 year ago • 2 comments

On ipad Safari, Here is a test case.

  • SceneA and SceneB load html5 audio individually.
  • SceneA can play sound after touch event
  • SceneB needs touch event to unlock loaded html5 audio.

Is it possible unlock html audio one time, instead of unlock per-scene?

rexrainbow avatar Mar 17 '23 15:03 rexrainbow

This whole section needs recoding, I'll have a look at it.

photonstorm avatar Mar 17 '23 16:03 photonstorm

Play html audio with Howler.js

Compared with phaser3's html audio on ipad safari

  1. Howler: SceneA can play sound after 1 touch event. P3 : SceneA can play sound after 2 touch events. Guess that one for unlock, the other for playing audio
  2. Howler: SceneB can play sound wo any touch event P3 : SceneB can play sound after 1 touch event.

It seems that P3 html audio needs 1 extra touch event, per scene.

rexrainbow avatar Mar 18 '23 08:03 rexrainbow