Reputation: 5844
I think cordova-plugin-media is the most popular plugin for playing audio with Cordova. It works great, but whenever a sound is played, the native music player Android app stops. I tested it on my Samsung Galaxy Young GT-S6310 with Android 4.1.2.
I want to be able to play a short sound from my app without interrupting any other apps that play some kind of audio, because it's pretty annoying for the user.
Is there any way I could achieve that with the Media plugin? If not, is there any other plugin that could do the job?
Upvotes: 2
Views: 468
Reputation: 83
Did you try using Audio from javascript directly without using the plugin? https://www.w3schools.com/tags/ref_av_dom.asp
var yourAudio = new Audio('yourfile.mp3');
yourAudio.play();
If it is for a short audio and your app is not in the background, this may work for you. (I did not test it myself, but I'm assuming this method will not pause any ongoing media play).
Upvotes: 0