iosavplayeravplayerviewcontrollermpnowplayinginfocenter

MPNowPlayingInfoCenter does't show previous and next buttons


I'm playing a video using AVPlayerViewController, and I noticed that in now playing center, previous and next buttons were replaced with 15 seconds back and forth seeking buttons. The problem is that I need previous and next buttons to be visible. Also I set updatesNowPlayingInfoCenter property to NO.

See the images below for a better understanding:

Current UI:

enter image description here

Wanted result:

enter image description here


Solution

  • After some researching, I've found a solution: just disabled backward and forward MPSkipIntervalCommand:

    MPRemoteCommandCenter *rcc = [MPRemoteCommandCenter sharedCommandCenter];
    
    MPSkipIntervalCommand *skipBackwardIntervalCommand = [rcc skipBackwardCommand];
    [skipBackwardIntervalCommand setEnabled:NO];
    
    MPSkipIntervalCommand *skipForwardIntervalCommand = [rcc skipForwardCommand];
    [skipForwardIntervalCommand setEnabled:NO];