Skip to main content
Participant
April 24, 2021
Question

Createjs sounds not working in iOS Safari

  • April 24, 2021
  • 1 reply
  • 663 views

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

 

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    April 24, 2021

    try putting that play() method in a mouse event listener function.

    Participant
    April 24, 2021

    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.

    kglad
    Community Expert
    Community Expert
    April 24, 2021

    yes , test if a click is needed.