pauses when screen is locked or app's minimized

I use cordova media plugin and want my audio keep playing after either screen’s locked or app gets minimized on my ios device. I tried to specify playAudioWhenScreenIsLocked option but had no luck. Did I miss something?

You may want to check out this plugin

Which should keep the app running in the background

1 Like

Thanks for answering. It seems that cordova-plugin-background-mode doesn’t help to keep playing either.

Have you found a solution? I play it in background, but it is very glitchy and looks like something is killing the thread every 2 seconds.

Hi, have you been able to resolve this. I am having this issues in 2020

Works on IOS.


cordova-plugin-background-mode - Keep app running in background

In my config.xml

< plugin name=“cordova-plugin-background-mode” source=“npm” spec=“0.7.3” />

In my index.js

onDeviceReady: function() {

Using Cordova for iOS we put audio to play in background mode and it resolved the issue where the file would stop when the phone fell asleep. Now we are facing a new issue.

When app is minimized or when users go to a different screen within app, the audio wont stop. We need it to pause/stop but cannot seem to find an answer for this. Using the Cordova audio plugin everything to work perfectly with Android but with iOS were facing all these issues.