I'm working on a music playing app and in previous iOS versions the media player would show the play/pause as well as the skip and prev buttons. Now, with the 8.4 update, all that is shown is the play/pause. I'm updating the MPNowPlayingInfoCenter in the usual way:
NSDictionary* nowPlayingInfo = @{
MPMediaItemPropertyTitle:[self.currentSong title],
MPMediaItemPropertyArtist:[self.currentSong artist],
MPMediaItemPropertyPlaybackDuration:[NSNumber numberWithDouble:(double) self.duration],
MPNowPlayingInfoPropertyElapsedPlaybackTime: [NSNumber numberWithDouble:(double)self.currentPlaybackTime],
MPNowPlayingInfoPropertyPlaybackRate: self.isPlaying ? @1.0 : @0.0,
MPMediaItemPropertyArtwork: mediaPlayerArtwork,
MPNowPlayingInfoPropertyPlaybackQueueIndex: [NSNumber numberWithInteger:playQueue.queuePosition],
MPNowPlayingInfoPropertyPlaybackQueueCount: [NSNumber numberWithInteger:playQueue.queueIDs.count] };
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:nowPlayingInfo];
But the result is...
and
Thanks for any help!
In order to get the next and prev buttons back you need to add:
[[MPRemoteCommandCenter sharedCommandCenter].nextTrackCommand addTarget:self action:@selector(remoteNextPrevTrackCommandReceived:)];
[[MPRemoteCommandCenter sharedCommandCenter].previousTrackCommand addTarget:self action:@selector(remoteNextPrevTrackCommandReceived:)];
I added this in AppDelegate's
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
If you're already receiving remote events the action method can be empty:
-(void) remoteNextPrevTrackCommandReceived:(id)event {}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With