5
votes

I can't retrieve MPMediaItemPropertyArtwork while playing a song from Apple Music with iOS 8.4

I've try to read image of nowPlayingItem

(lldb) po [[[MPMusicPlayerController systemMusicPlayer] nowPlayingItem] valueForProperty:MPMediaItemPropertyArtwork] <MPConcreteMediaItemArtwork: 0x174478940>

But the object returned is empty:

(lldb) p (CGRect)[[[[MPMusicPlayerController systemMusicPlayer] nowPlayingItem] valueForProperty:MPMediaItemPropertyArtwork] bounds] (CGRect) $2 = (origin = (x = 0, y = 0), size = (width = 0, height = 0))

And obviously the returned image is always nil

there's another way to get the nowPlayingItem MPMediaItemPropertyArtworkimage?

1
Did you ever find an answer to this? I just ran up against it myself.solenoid
Same here, any updates? Thanksrjb101

1 Answers

1
votes

This behaviour happens when you are streaming songs from Apple Music which are not saved to the users library.

I've filed a bug report for this, and I think you should do too 😉 You can dupe rdar://25413082 if you want.

The best workaround is to use the iTunes API (or similar) to retrieve the album Art although this won't give perfect results 100% of the time.