我注意到设置 new nowPlayingInfo
of 会[MPNowPlayingInfoCenter defaultCenter]
替换MPMediaItemPropertyArtwork
每个新 perform 的值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];
每次播放曲目更改时都会执行此块