I’m not sure where to post about this, so I’m going to do it here. I already created a bug in the cordova apache but had no response.
see: https://issues.apache.org/jira/browse/CB-12898
The issue is with a new media file that can’t be “STARTED” when the screen is locked (or app is in background).
I’m not referring to the background playing settings in iOS.
This still happens even if I set the UIBackgroundModes setting.
Steps to produce:
1- Play File A from the App (Plays fine)
2- Lock the screen (Audio continues to play)
3- audio finishes and tries to start the next audio (in case of playing a playlist) (This fails)
I’m more convinced that this is a JavaScript issue more than a Cordova Media Plugin issue. However, I’m still not sure on how to resolve it.
It seems that when the first song finishes playing and the JavaScript tries to start the next song in the songs array, the JavaScript does not run when the phone is locked (app is in background).