Commit 93190839 authored by Felix Paul Kühne's avatar Felix Paul Kühne

playback controller: use the modern openURL API if available

parent 8c06b5d3
...@@ -294,14 +294,21 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) { ...@@ -294,14 +294,21 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
_playerIsSetup = NO; _playerIsSetup = NO;
[_shuffleStack removeAllObjects]; [_shuffleStack removeAllObjects];
if (@available(iOS 10, *)) {
if (_errorCallback && _mediaPlayer.state == VLCMediaPlayerStateError && !_sessionWillRestart)
[[UIApplication sharedApplication] openURL:_errorCallback options:@{} completionHandler:nil];
else if (_successCallback && !_sessionWillRestart)
[[UIApplication sharedApplication] openURL:_successCallback options:@{} completionHandler:nil];
} else {
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations" #pragma clang diagnostic ignored "-Wdeprecated-declarations"
/* UIApplication's replacement calls require iOS 10 or later, which we can't enforce as of yet */ /* UIApplication's replacement calls require iOS 10 or later, which we can't enforce as of yet */
if (_errorCallback && _mediaPlayer.state == VLCMediaPlayerStateError && !_sessionWillRestart) if (_errorCallback && _mediaPlayer.state == VLCMediaPlayerStateError && !_sessionWillRestart)
[[UIApplication sharedApplication] openURL:_errorCallback]; [[UIApplication sharedApplication] openURL:_errorCallback];
else if (_successCallback && !_sessionWillRestart) else if (_successCallback && !_sessionWillRestart)
[[UIApplication sharedApplication] openURL:_successCallback]; [[UIApplication sharedApplication] openURL:_successCallback];
#pragma clang diagnostic pop #pragma clang diagnostic pop
}
[[self remoteControlService] unsubscribeFromRemoteCommands]; [[self remoteControlService] unsubscribeFromRemoteCommands];
......
Markdown is supported
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