cordova-music-controls-plugin icon indicating copy to clipboard operation
cordova-music-controls-plugin copied to clipboard

Music controls don't work with background mode on iphone

Open madmandrew opened this issue 6 years ago • 5 comments

Using ionic 3 and deploying to iphone. When background mode is enabled music controls don't show up at all. with background mode turned off music stops on screen lock and music controls show up but don't do anything.

cordova-plugin-music-controls: 2.1.4 cordova-ios: 4.4.0 cordova-plugin-background-mode: 0.7.2

madmandrew avatar Jul 22 '18 02:07 madmandrew

Make sure you are using the UIWebView and not the new WKWebView in Ionic. (WKWebView is the default) https://ionicframework.com/docs/wkwebview/

neoassyrian avatar Jul 24 '18 12:07 neoassyrian

Tried both options for downgrading and still didn't work

I was able to get it to work by using the ionic media plugin. This for some reason runs the audio in the background without the background mode on.

madmandrew avatar Jul 27 '18 01:07 madmandrew

https://github.com/katzer/cordova-plugin-background-mode/pull/274/files

fixes it

TylerAHolden avatar Aug 23 '18 19:08 TylerAHolden

This plugin doesn't use https://github.com/katzer/cordova-plugin-background-mode though right? or am I supposed to install the plugin?

khevamann avatar Sep 19 '18 22:09 khevamann

The problem with the background mode plugin is that it plays a silent audio file in the background continuously to fake activity and stop suspension of the app even when it's idle. It may be fixed now but the problem was that the background-mode plugin steals the audio session.

I would recommend giving the ionic-webview plugin a look if you want background processing support as it enables background processing but doesn't fake any work load so the OS can still suspend your add as it needs to when it is idle.

ghenry22 avatar Dec 01 '18 03:12 ghenry22