如何更改现在保留旧图稿的MPNowPlayingInfoCenterPlayingInfo

时间:2012-08-03 15:13:13

标签: objective-c ios mpnowplayinginfocenter

我注意到,设置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];

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

0 个答案:

没有答案