Ionic 2 version: Audio pauses when device goes to standby / app is in background
On Android the audio track keeps playing even if the device is going to standby or the Ionic App is in background. This behaviour is expected and as far as i remember, it was the same for the Ionic 1 version on Android and iOS as well.
The Ionic 2 version keeps playing on Android but on iOS it will pause the track and start it again, when the device is turned on and unlocked again or the app is in foreground again.
@marteb Interesting... i would have to test on iOS. I develop on Windows but I can run a VM with OS X to deploy on iOS. I will try to find time to fix this. What I remember is that I needed to enable background audio on xcode for it to work. Have you done that?
That’s a good hint i could have found by myself :) Will try this later and give you feedback…
Unfortunately enabling the setting „Background Modes: Audio“ in Xcode doesn’t fix this.
@marteb Do you know if it uses native or html5 audio in your case? I have same issue and was thinking about the possibility that it could be related to html5 audio
@marteb I installed this plugin and background audio now works for me in iOS too https://github.com/EddyVerbruggen/cordova-plugin-backgroundaudio
I have just upgraded the module to Ionic 2 final. There are some minor changes in the way the module is set up in the app.module.ts. I tested on Android so far.
Updated docs:
http://arielfaur.github.io/ionic-audio/2.0/index.html
@marteb and @arielfaur the suggestion from @sjosen worked for me as well.
I installed this plugin and background audio now works for me in iOS too https://github.com/EddyVerbruggen/cordova-plugin-backgroundaudio
Does this work now? Background audio plugin seemed to have done the trick? Can we close this issue?
I have this same issue in my ionic 1 app keeps playing on Android but on iOS it will pause the track and start it again, when the device is turned on and unlocked again Can you please help me with a solution