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

I can't get IOS to make a sound when using a HTML5 Canvas

Community Beginner ,
Dec 18, 2020 Dec 18, 2020

Copy link to clipboard

Copied

When I try to place a button on my HTML5 canvas that activates a sound (mp3) it works fine on desktops and android devices but not on my IOS device (Iphone IOS 14.2). 

 

When I use this code in the first frame:

this.aBtn.addEventListener("click",clicked);
function clicked(){
    createjs.Sound.play("sound");
}

After creating a button with the instance name aBtn and added a file.mp3 to the library with a linkage name sound I don't hear anything on my IOS device (with Safari en firefox) . It does work great on my desktop and android phone.

 

I tried many different approaches but without success.

 

(I' using Adobe Animate 21.0)

 

Can somebody point me toward a solution?  Tnx in adv!  

TOPICS
Code , How to

Views

411

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

correct answers 1 Correct answer

Community Expert , Dec 18, 2020 Dec 18, 2020

Hi.

 

Making videos and sound work properly in iOS is always a challenge...

 

There several limitations and issues you should be aware of:

SoundJS v1.0.0 API Documentation : Sound (createjs.com)

 

It may be the WebAudio context that needs "to be 'unlocked' by playing at least one sound inside of a user- initiated event" - and that's the reason I added that initial check for Chrome -, or because of audio format, or plugins... It's really hard to tell.

 

You're gonna have to test it out.

 

I wish

...

Votes

Translate

Translate
Community Expert ,
Dec 18, 2020 Dec 18, 2020

Copy link to clipboard

Copied

LATEST

Hi.

 

Making videos and sound work properly in iOS is always a challenge...

 

There several limitations and issues you should be aware of:

SoundJS v1.0.0 API Documentation : Sound (createjs.com)

 

It may be the WebAudio context that needs "to be 'unlocked' by playing at least one sound inside of a user- initiated event" - and that's the reason I added that initial check for Chrome -, or because of audio format, or plugins... It's really hard to tell.

 

You're gonna have to test it out.

 

I wish I could be of more help.

 

Regards,

JC

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