I want to get programatically queue currently played in native Music App. I can use MPMusicPlayerController to get currently playing item but I want to get not only the item but whole playing queue. Is it possible to do it using AVFoundation or any other library?
Thank you
if you can to use Apple private api. this should be best.
I'm pretty sure this is not possible through any public API. The Ecoute app that @sooper mentions must be using private APIs. I did a little experiment in the codebase of my own music app. First I used this code to list all the methods in the iPod music player (put
#import <objc/runtime.h>
at the top):This turned up some intriguing method names like
numberOfItems
andnowPlayingItemAtIndex:
. So I added this category at the top of the file:and I ran this code:
and sure enough, it printed out the playlist that I had queued up in the Music app!
Of course, if you call these methods this way, Apple will reject your app, but there's a way to hide private API calls from Apple.
I've been looking into this and suddenly realized how simple it is!
mediaItemCollection is the current playlist!
hope this helps.
I'm afraid this is not possible. Apple does not give us access to this information from any libraries.