about music detect

i am working on music player in our desigining app to detect the any music is playing while app is background


like youtube are songs playing

Replies

i am working on music player in our desigining app to detect the any music is playing while app is background

Do you have a specific question about this?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I developing an app. In that app music player is there and added some functions like to open YouTube and music.


When I open the YouTube we will play some videos and our developing app is running at background.


In background app we want to detect any music are videos are playing and detect music and videos are stoped.

There’s two parts to this:

  • Can you access the current ‘now playing’ info? (A)

  • Can you do that in the background? (B)

I suspect that the answer to A is “No.” In general, iOS does not let app X know what app Y is doing, for obvious privacy reasons. However, I’m not an expert on media playback, so I’m going to recommend that you ask this specific question over in Media > AVFoundation (Audio).

With regards B, can you guarantee that you’re app is always running in the background? There’s definitely no way for your app to be resumed in the background when the current ‘now playing’ info changes, so if you’re not already running in the background for some other reason then this is going to be a blocker.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"