phonegap media plugin cant handle multiple sounds?

466 views Asked by At

I think this is not much to ask and should be a default of some kind.

The media plugin in phonegap, which should let sounds play in the native way (or am i wrong) won't let 2 sounds play together without interfering with one another.

For example, if a background music is played, and then a sound of some kind occur, then the background stops and then nothing (it happens just in the end of the current playback for some reason).

Is there any alternatives?

1

There are 1 answers

0
totothegreat On

So after a long research and trial and error there was no other way but to do it with the wonderfull plugin:

https://github.com/floatinghotpot/cordova-plugin-nativeaudio

It seems it uses html5 sound but that works just great for phonegap game app!, if you dont have a game, use the media plugin.

Some code examples are right there for you, very important note, for phonegap build there are 2 plugins that seems to come from the same awesome developers, there is the nativeaudio and there is the lowlatencyaudio, use the latter, for some reason nativeaudio have some problem with ios8