[aerogear-dev] Sound issue Cordova iOS and notation

Sebastien Blanc scm.blanc at gmail.com
Wed Mar 19 13:40:51 EDT 2014


On Wed, Mar 19, 2014 at 5:50 PM, Miguel Lemos <miguel21op at gmail.com> wrote:

> Hi
>
> The sound event when the notification arrives doesn't seem to work (at
> least on iPhone; Android not tested yet).
>
> And yes: the sound plugin is installed and working just fine.
>
> Besides, I don't understand quite well the way you build the event.
> Example given by you for Android:
>
> var my_media = new Media("/android_asset/www/" + e.sound);
>
> ..What sound? I can have several sounds on a given folder...
>
I haven't play too much with sound but e.sound is supposed to contain the
filename of your sound file (like beep.wav / sirene.wav ...)

>
> I think a better - and more trivial - approach would be something like
> this (just an opinion...):
>
> if (e.sound) {
> if (device.platform == "Android") {
> media = new Media("/android_asset/www/beep.wav");
>  } else if (device.platform == "iOS") {
> media = new Media("beep.wav"); // root directory
>  }
> media.play();
>           }
>
>
> Thanks guys :-)
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20140319/820ddb02/attachment.html 


More information about the aerogear-dev mailing list