nextTrackCommand和seekForwardCommand都同时被调用

时间:2018-09-25 14:49:27

标签: ios mpremotecommandcenter

似乎当我在播放某些东西(模拟器或设备)时在控制中心上按“下一个”时,nextTrackCommandseekForwardCommand都被调用。

这两个功能都已启用,但是只要轻按“下一步”按钮就不会调用这两个功能。

更多代码:

[MPRemoteCommandCenter sharedCommandCenter].playCommand.enabled = YES;
[[MPRemoteCommandCenter sharedCommandCenter].playCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
    return MPRemoteCommandHandlerStatusSuccess;
}];

[[MPRemoteCommandCenter sharedCommandCenter].nextTrackCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
    NSLog(@"nextTrackCommand");
    return MPRemoteCommandHandlerStatusSuccess;
}];
[MPRemoteCommandCenter sharedCommandCenter].nextTrackCommand.enabled = YES;

[[MPRemoteCommandCenter sharedCommandCenter].seekForwardCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
    NSLog(@"seekForwardCommand");
    return MPRemoteCommandHandlerStatusSuccess;
}];
[MPRemoteCommandCenter sharedCommandCenter].seekForwardCommand.enabled = YES;

我已将波纹管链接到一个演示此问题的示例项目。

https://docs.mongodb.com/manual/reference/operator/projection/elemMatch/

0 个答案:

没有答案