|
Post by Hippani on Feb 12, 2013 16:14:34 GMT
As many of you know, it's impossible to play sounds on apple devices without user interaction e.g. click something first.
The solution is to turn off autoplay and add a play button at the beginning of the movie with 'on click' code like:
PlaySound("BackgroundMusic",false); PlayClip(1,100);
Here's a trick, so that the button only appears on apple devices.
Add this code to the movie properties, 'on start' event.
var NotAppleDevice=navigator.userAgent.indexOf("iPhone")==-1&&navigator.userAgent.indexOf("iPad")==-1; if(NotAppleDevice){ PlaySound("BackgroundMusic",false); PlayClip(1,100); }
This code will skip past the button if an apple device is not detected.
Hippo Animator 2.3 required.
|
|
|
Post by Hippani on Mar 26, 2013 16:33:51 GMT
Hello Guys if you want to playing audio app on iphone or ipad then you must visit that url: edumobile.org/iphone/ipad-development/playing-audio-file-in-ipad/ This link shows how to create iPad apps using XCode, I don't think this is relevant to this forum. This forum is more about HTML solutions.
|
|
|
Post by bettyke on Dec 23, 2014 10:03:20 GMT
Short update: added the play and replay buttons with GotoAndPlay(1); PlaySound("white",false); but still no sound on the iPad. Any suggestions? Please help. Thanks, Betty
|
|
|
Post by awilson3rd on Dec 24, 2014 10:15:05 GMT
Hello,
I had a few problems with sound on mobile devices (including apple) but with Gordon's help managed to get it sorted. Here is what I do.
Add a new button and call it 'playsound' Add this button to the timeline at frame 0 with transition set to off (just click the transition checkmark to set it to off). When the soundplay button is highlighted in the timeline add a new frame at 1 (just double click it) and make sure this is set to no transition too.
In the edit options for the button just added in the On Click option add SoundPlay("yourmusicfile",true); GotoAndPlay(1);
Then, in the movie properties in the 'On Start' option add:
if(CanAutoPlay()){ //if the browser supports automatically playing sounds. SoundPlay("yourmusicfile",true); GotoAndPlay(1); }
What this does is set the music to play by default on browsers that support auto playing of music, for example desktop. In a browser that does not support auto playing the button will appear with whatever text you added to the button, for example 'click here to play'
The 'true' option in the above code sets the music to loop.
Also, in movie properties make sure the 'Auto Play' option is turned off.
Hope that helps!
Andrew
|
|