I am creating an iOS application that broadcasts shoutcast audio.
I want to display my own image on the device’s locked screen (no matter what song, I want the image to be displayed the same way).
The code below shows the current title on a locked screen, but it does not display the album art as soon as the image below.
Perhaps the first (I think Mixcloud reaches it)? If so, what's wrong with that? The source is here.
Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter");
if (playingInfoCenter) {
NSMutableDictionary *songInfo = [[NSMutableDictionary alloc] init];
UIImage * albumImage = [UIImage imageNamed: @"icon_HD.png"];
MPMediaItemArtwork * albumArt = [[MPMediaItemArtwork alloc] initWithImage:albumImage];
[songInfo setObject:titre.text forKey:MPMediaItemPropertyTitle];
[songInfo setObject:artiste.text forKey:MPMediaItemPropertyArtist];
[songInfo setObject:albumArt forKey:MPMediaItemPropertyArtwork];
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songInfo];
}
https://lh6.googleusercontent.com/-yV8VbLatlxg/UoD7Pq-Hv1I/AAAAAAAAALVg/UEwKUp00k2U/s1600/iOS-7-lock-screen-music-controls.png
David source
share