Control music of other apps within my app - ios

I'm currenty trying to find out if it's possible to control the music of other apps, e.g. Spotify, within my app. The two solutions I found are:
using the SDK of the specific service (e.g. Spotify SDK)
take over the audio session in my app, but this only allows me to stop/ play the music
I'm trying to find a solution that provides me with pause, play, forward, backward control and access to the title, maybe also the cover. Then I came across the "Sony Headphones Connect" app. It has a page with media control buttons, the title of the current song and is does not require any kind of sing in to Spotify or something else.
Picture is from the app from the App Store, I tested the controls and they work.
So somehow it must be possible, does anyone have an idea how I can achieve my desired result or how the "Sony Headphones Connect" app is handling this issue?

I think I found the answer, the "Sony Headphones Connect" app is controlling the music over bluetooth. So it's not directly possible to control the music of another app.

Related

Control other apps music playing from inside my app?

Inside my app I'd like to have a control to stop/play, skipToNext and goToPrevious song if any other app is already playing music. Similar to what the control-center does already, but I wand those buttons to be available inside my app.
I've seen that MPMusicPlayerController allows that for the Apple Music app using skipToPreviousItem(), skipToBeginning(), skipToNextItem(). But I'm looking for a solution that would work for any other app (SoundCloud, Spotify, Deezer, ...), similarly as the control-center does.
Is there any way to control other apps music playing from inside my app?
There are two potential workarounds:
A) There is a Spotify App Remote SDK now https://github.com/spotify/ios-app-remote-sdk#sptappremoteuserapi. You can use that to control the Spotify app directly.
B) If you can live with only controlling stop/play you can take over the audio session which will stop Spotify and then end your session hoping that Spotify will automatically resume.

Control Spotify from your own app

I want to put in my app just one PLAY button and when user will press on that button, to play the song directly in Spotify. It will like a controller, so I can switch songs in Spotify from my own app.
Now I created something, but it plays on my own app. Is there any ways to control my music streaming in spotify via my own app?
For example I press "Next song" and it switches in Spotify app to the next song.
I hope I could explain what I want, if not - please ask me
URL Schemes are the only way to communicate between apps. It is not possible to launch non arbitrary apps.
Then you need to use Spotifys API and they do not currently have any support for that.

Control Spotify background music in iOS app

I'm making an app that uses gestures to change the current background music e.g Pause, Skip, etc. Currently I can do this fine for music that is playing through the native MPMusicPlayerController class.
However I am unable to control the music when it is coming from Spotify (or other music playing apps for that matter). I believe this is to do with Apple's sandboxing policy between apps.
I'm not too hopeful, but does anyone know a way to trigger a universal music control notification? Something similar to what must happen on the iOS lockscreen when background music is playing? All my research tells me this almost definitely done through a private API, but am unable to get confirmation.
Alternatively, is there any Spotify specific way to achieve this?
Unfortunately the answer is No.
You can't get any information/Notifications about other apps, even regarding what's now playing.
As you wondered, it's all regarding the Sandboxing policy of Apple.

How to Trigger custom Video player While playing any video in iphone?

I want to create a Custom Video Player with some more features and settings .
So My question is:
1) Can i trigger my app when user clicks any video ?
2)How can i get list of all videos saved in iPhone (not in camera roll) ?i want to play them inside the video player i created.
Please guide me, thanks.
I don't think you can capture all video. External Apps tend to use Apple's native video support.
The only exception to this is if you register your application to open certain filetypes. Then applications can allow you to open the file in an external app such as yours. But this will require the cooperation of the other apps to implement "Open In" functionality; Very few apps tend to offer this functionality due to native support of video.
See here Apple Documentation
The filesystem is locked down, if it's not in the camera roll or "Open In" you can't access it.

Is there any way I can make podcast application from iphone play my podcasts ? ( with code )

I'm doing an application that can play podcasts, but i feel more comfortable if the iPhone default podcast application plays the files, instead of me having to handle them.
When I pass the URL to the sharedApplication object, Safari opens and starts playing it ... but I'd like to skip the user seeing Safari. Is there any way?
The podcasts app does not have a public API. Therefore you cannot get it to play podcasts on your behalf.
Since the podcasts are added to your media library you should be able to find them with a media library query and start background playback easily.

Resources