Background audio not work with Ionic3 + Videogular2 on iOS - ios

I'm using Videogular2 in an Angular/Cordova/Ionic3 project, where I play mp3 audio live streams. All works good with mp3 and mp4, on browser and iOS simulator.
When the user Lock The Screen in iOS Device I expect that the audio continues to play in a background mode, but on IOS when the user Lock The Screen audio stop to play.
I've tested on XCODE 8 to set 'Capabilities' tab adding 'audio' parameter, I've added cordova-plugin-backgroundaudio to the project without success.
On iOS Simulator it works well, the problem occurs only on iOS Device.
Tested on iPhone 6 & iPad 3.
I'm using:
iOS 10.3.3
XCODE 8.3.3
Ionic 3.12.1
Videogular2 5.4.11
No one else used videogular2 on cordova/ionic?

In iOS app audio won't be playing in background when the device is locked. For that you have to enable the background mode for the app. I had faced the same issue in one of my application (I was using different audio plugin).
In order to enable background mode in iOS you can use below plugin
https://ionicframework.com/docs/native/background-mode/. When you start playing the audio you just need to call backgroundMode.enable() to keep it playing in background. When you leave the audio player page if want you can disable background mode to avoid unnecessarily keeping the background mode on by calling backgroundMode.disable().
Additionally you need to enable the background audio feature in xcode project settings as shown in below link.
https://koenig-media.raywenderlich.com/uploads/2016/09/BM-EnableAudioInBG.png

Related

Background music ducked when Unity3D game is launched

I'm developing a casual game for iOS with the Unity3D engine.
Whenever my game is launched, the background music being played on the device (e.g.: Spotify, iTunes, etc.) is ducked. This is undesired because my game does not have any fancy sound effects, I' like to allow my players to keep listening to their music in the 'normal' volume.
For testing purposes I created an empty project in Unity3D, ensuring the Override iPad Music setting is unchecked in the iOS Build Settings. This is enough to reproduce the audio ducking issue.
INFO:
Unity 5.4.x (also occurs with Unity 5.3.x)
Xcode 8
iOS 9 and iOS 10
Does anyone know how disable Unity3D's default audio ducking?
Add an Audio mixer to the output of your audio source. On the Audio mixer in the project tab, click the drop down then click on master. Finally increase the attenuation volume to a level your feel satisfied with. Then you are good to go.

No sound when playing video in ionic app on an iPhone device

I have an ionic app that plays videos hosted on the internet. When testing the app on a web browser and in the iOS emulator the video plays with sound.
If I download the app onto my iPhone using X-Code the video plays but there is no sound!
Does anyone have an idea as to why the sound works on the emulator but not on the actual device? I have checked that youtube videos play ok with sound.
Ok, so I am clearly an idiot! The mute slider on my iPhone was turned on. Not sure though why this didn't mute youtube videos but did mute my app videos.
For those wondering why sound isn't working in the ionic view app for an iOS device, but it works in an iOS emulator like I was:
The ionic view app comes with a fixed set of cordova plugins. If your app needs a plugin which the ionic view app doesn't support thenyour app won't work in the ionic view app. The sound plugin I was using in my emulator wasn't supported in the ionic view app.
Edit: list of supported ionic view apps can be found here: http://docs.ionic.io/docs/view-usage

Can app tested in iPhone run in background?

I write an audio player app with Xcode 6 in iOS 8. The problem is, when the audio player runs in iOS simulator, it can play audio in background, but when I test it in the real iPhone device, it cannot play audio in background. I wonder if Apple has limitation in testing in real iPhone device or I make some mistakes in settings.

Qt Quick iOS: How to keep audio playing while app is in background

I’m developing a WebRadio application in qml for iOS devices with Qt 5.2. To play the audio stream I use the MediaPlayer type which works fine.
However, in iOS, when I switch to another application or go back to home (in other words when the app go to background) the sound stops, but I want it to continue playing.
I know how to do it in objective-C by activating the AVAudioSession and add the audio background mode the info.plist file.
But I really don't know how to do it in qml.
Can someone help ?
You can add the audio background mode to the info.plist file or via the capabilities tab in Xcode.

Start audio recording when the application is in background on jailbreak iOS device

Is there a way to start the audio recording when the application is in background. It doesn't looks possible if we intend to hit app store. But since we are developing on Jailbreak device I wouldn't mind using any private frameworks or hacks.
Also anybody worked out how to prevent the red status bar while record is happening in the background.

Resources