Commit 171f0909 authored by Mike JS. Choi's avatar Mike JS. Choi Committed by Carola
Browse files

[Playback] Check for iOS 9.1 availability

`ChangePlaybackPosition` is available with iOS 9.1 and up

(cherry picked from commit 782c3dd3)
parent a37bc071
...@@ -129,10 +129,12 @@ static inline NSArray * RemoteCommandCenterCommandsToHandle() ...@@ -129,10 +129,12 @@ static inline NSArray * RemoteCommandCenterCommandsToHandle()
[_remoteControlServiceDelegate remoteControlService:self setPlaybackRate:rateEvent.playbackRate]; [_remoteControlServiceDelegate remoteControlService:self setPlaybackRate:rateEvent.playbackRate];
return MPRemoteCommandHandlerStatusSuccess; return MPRemoteCommandHandlerStatusSuccess;
} }
if (event.command == cc.changePlaybackPositionCommand) { if (@available(iOS 9.1, *)) {
MPChangePlaybackPositionCommandEvent *positionEvent = (MPChangePlaybackPositionCommandEvent *)event; if (event.command == cc.changePlaybackPositionCommand) {
[_remoteControlServiceDelegate remoteControlService:self setCurrentPlaybackTime:positionEvent.positionTime]; MPChangePlaybackPositionCommandEvent *positionEvent = (MPChangePlaybackPositionCommandEvent *)event;
return MPRemoteCommandHandlerStatusSuccess; [_remoteControlServiceDelegate remoteControlService:self setCurrentPlaybackTime:positionEvent.positionTime];
return MPRemoteCommandHandlerStatusSuccess;
}
} }
NSAssert(NO, @"remote control event not handled"); NSAssert(NO, @"remote control event not handled");
APLog(@"%s Wasn't able to handle remote control event: %@",__PRETTY_FUNCTION__,event); APLog(@"%s Wasn't able to handle remote control event: %@",__PRETTY_FUNCTION__,event);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment