I'm working on Intel xdk, which is based on phonegap 3.5.1. Testing on android 4.4.4 and 5.0.1
Using media api, I'm trying to play audio for a defined duration, after which next audio should start, and thus loop on.
For this I'm using setTimeout for delay until one audio ends.
The audio needs to play in background as well.
Now the problem is, even when audio is playing and looping as expected, setTimeout doesn't get fired in background and audio keeps on playing.
Also, the results are inconsistent, quite accurate on Android 4.4.4 but highly varying on Android 5.0.1.
Please suggest what to do? Can I buffer audios or concatenate audio files to prepare one single file with defined durations and then play complete file? If yes, how?