0

How to setup MPRemoteCommandCenter/MPNowPlayingInfoCenter to add seek buttons? Result that I want to achieve is on the screenshot. Seek buttons should look like I have already added this code:

[[MPRemoteCommandCenter sharedCommandCenter].seekForwardCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
    [weakSelf rewindForward];

    return MPRemoteCommandHandlerStatusSuccess;
}];
[MPRemoteCommandCenter sharedCommandCenter].seekForwardCommand.enabled = YES;

[[MPRemoteCommandCenter sharedCommandCenter].seekBackwardCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
    [weakSelf rewindBackward];

    return MPRemoteCommandHandlerStatusSuccess;
}];
[MPRemoteCommandCenter sharedCommandCenter].seekBackwardCommand.enabled = YES;
rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

1

You would also need to set preferredIntervals as described in https://stackoverflow.com/a/24818340/1514970.

buildc0de
  • 193
  • 5