Copy link to clipboard
Copied
I have a html5 canvas project that i'm working on. Very simple, and everything works on a desktop and on an iPad. However, sound is not working on an iPhone. I have done a lot of reading and i've tried to follow guides to make the initial click at the start of the project load the sound... but it doesn't work.
Link to the game: https://filedn.com/lskcCw1QJLAJNzkfocSB4mj/Game%2006/game_06d.html
This is the code that i used on frame 1 at the time when the user pushes the start button: (i tried click and mousedown)
this.button_start.addEventListener("mousedown", fl_MouseClickHandler_3.bind(this));
function fl_MouseClickHandler_3() {
this.gotoAndPlay('start');
createjs.Sound.on("fileload", handleFileLoad);
createjs.Sound.registerSound("sounds/alef_01.mp3", "alef_01");
}
and this is what i used later on in the project to play the sound:
createjs.Sound.play("alef_01");
Copy link to clipboard
Copied
try putting that play() method in a mouse event listener function.
Copy link to clipboard
Copied
Thanks for the reply. But that would require another click, right?
I'm hoping to play the sound effect at a point that does not have a mouse click.
Copy link to clipboard
Copied
yes , test if a click is needed.