我注意到,设置nowPlayingInfo
的新[MPNowPlayingInfoCenter defaultCenter]
替换MPMediaItemPropertyArtwork
每个新的setNowPlayingInfo:
值。但是在标准的iphone music.app中它不会发生!那么如何设置nowPlayingInfo
保留旧作品?
NSMutableDictionary *mediaInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:recording.releaseGroup.title, MPMediaItemPropertyAlbumTitle, recording.releaseGroup.artist.title, MPMediaItemPropertyArtist, recording.title, MPMediaItemPropertyTitle, recording.lyrics, MPMediaItemPropertyLyrics, itemsCount, MPMediaItemPropertyAlbumTrackCount, itemNumber, MPMediaItemPropertyAlbumTrackNumber, nil];
self.artwork = [[[MPMediaItemArtwork alloc] initWithImage:_coverView.image] autorelease];
[mediaInfo setValue:_artwork forKey:MPMediaItemPropertyArtwork];
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:mediaInfo];
每次更改曲目时都会执行此块