I search a lot about my problem and I found no solution. In my app using Cordova, I play mp3 sounds. Everything is fine except when you played background music (mp3s, google music, ...), the sound stop the background music. I would like to not stop the background music when my sound is played.
I tried 3 differents methods:
1 - Plugin: cordova-plugin-media
When the sound play, the background music stops and do not restart at the end.
2 - Plugin: cordova-plugin-nativeaudio
Worst, the background music stops when I launch my application
3 - Using javascript function
var mySound = new Audio('sounds/entering.mp3');
mySound.play();
Works fine on Android, the sound is playing, the background music volume decrease and after the sound is finished, the volume of the background music come back to normal. On iOS, the background music stops and do not replay at the end.
Does anyone already had this problem?
Thanks!