1

我注意到设置 new nowPlayingInfoof 会[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];

每次播放曲目更改时都会执行此块

4

0 回答 0