Open JCardenete opened 6 years ago
@JCardenete You can play two streams simultaneously by setting your audio session to allow mixin of other audio sources: https://developer.apple.com/documentation/avfoundation/avaudiosession/categoryoptions/1616611-mixwithothers
For more info on configuration Audio Sessions see Apple's documentation here https://developer.apple.com/library/archive/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionBasics/AudioSessionBasics.html
Thanks @jackfreeman, that worked. Downside of this is we're losing control of the remote control center which is now owned by Spotify. So pausing/playing from there will only affect Spotify's stream but not ours.
@JCardenete have a look at MPNowPlayingInfoCenter. Since your app is in the foreground it should be able to set the media controls.
There is also MPRemoteCommandCenter
Yes, we're using those already. But it seems that when setting the 'mixWithOthers' iOS doesn't consider your app to show in the remote control center.
@JCardenete You might try duckOthers too to see if it gives you priority on the control center (this will lower the volume of Spotify when sounds from your app play)
That didn't work either @jackfreeman, 'mixWithOthers' is making our app irrelevant for the control center.
When the Spotify app starts playing, it's automatically interrupting a stream that is playing from within my app. I could handle both with the previous SDK but I'm not sure if this is possible with the new one?