MPNowPlayingInfo ディクショナリを変更し、新しいパラメータを設定します
MPNowPlayingInfoPropertyPlaybackRate to 1.0f to show pause button
MPNowPlayingInfoPropertyPlaybackRate to 0.0f to show play button
再生ボタンから一時停止ボタンまで
Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter");
if(playingInfoCenter) {
NSMutableDictionary *songInfo = [NSMutableDictionary dictionaryWithDictionary:[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo];
//[songInfo setObject:songTitle forKey:MPMediaItemPropertyTitle];
//[songInfo setObject:songArtist forKey:MPMediaItemPropertyArtist];
[songInfo setObject:[NSNumber numberWithFloat:1.0f] forKey:MPNowPlayingInfoPropertyPlaybackRate];
[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo = songInfo;
}
一時停止ボタンから再生ボタンへ
Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter");
if(playingInfoCenter) {
NSMutableDictionary *songInfo = [NSMutableDictionary dictionaryWithDictionary:[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo];
//[songInfo setObject:songTitle forKey:MPMediaItemPropertyTitle];
//[songInfo setObject:songArtist forKey:MPMediaItemPropertyArtist];
[songInfo setObject:[NSNumber numberWithFloat:0.0f] forKey:MPNowPlayingInfoPropertyPlaybackRate];
[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo = songInfo;
}