Get album artwork from song playing through Apple Music
Asked Answered
S

0

8

I am testing my app with Apple Music, my app grabs the current playing song and displays relevant information on it.

One of the steps is to get the album artwork, however I find that when the song is playing from Apple Music it does not contain any artwork.

Here is my code, the first if condition is ran, which suggests that the artwork is initialized, however I get no image.

Does anyone know how I can get the artwork when the song is being played though Apple Music?

song is of type MPMediaItem

CGSize artworkImageViewSize = cell.albumImage.bounds.size;
MPMediaItemArtwork *artwork = [song valueForProperty:MPMediaItemPropertyArtwork];

if (artwork)
{
    cell.albumImage.image = [artwork imageWithSize:artworkImageViewSize];
}
else
{
    cell.albumImage.image = [UIImage imageNamed:@"noArtwork"];
}

Whenever I try to print artwork.bounds I get back null.

Syrinx answered 1/7, 2015 at 19:56 Comment(1)
Did you ever figure this out?Typhoid

© 2022 - 2024 — McMap. All rights reserved.