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
MPMediaItemPropertyArtwork
image?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With