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;
4

1 回答 1

1

您还需要preferredIntervals按照https://stackoverflow.com/a/24818340/1514970中的说明进行设置。

于 2017-05-26T16:03:11.080 回答