• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Createjs sounds not working in iOS Safari

New Here ,
Apr 24, 2021 Apr 24, 2021

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

 

Views

439

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 24, 2021 Apr 24, 2021

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 24, 2021 Apr 24, 2021

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 24, 2021 Apr 24, 2021

Copy link to clipboard

Copied

LATEST

yes , test if a click is needed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines