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

tvOS playback: iterate on menu navigation

parent febe3d16
......@@ -208,6 +208,16 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
- (void)panGesture:(UIPanGestureRecognizer *)panGestureRecognizer
{
VLCMediaPlayer *mediaPlayer = [VLCPlaybackController sharedInstance].mediaPlayer;
NSInteger currentTitle = mediaPlayer.currentTitleIndex;
NSArray *titles = mediaPlayer.titleDescriptions;
if (currentTitle < titles.count) {
NSDictionary *title = titles[currentTitle];
if ([[title objectForKey:VLCTitleDescriptionIsMenu] boolValue]) {
return;
}
}
switch (panGestureRecognizer.state) {
case UIGestureRecognizerStateCancelled:
case UIGestureRecognizerStateFailed:
......@@ -415,6 +425,11 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
if (recognizer.isLongPress) {
[mediaPlayer performNavigationAction:VLCMediaPlaybackNavigationActionActivate];
break;
}
break;
case UIGestureRecognizerStateEnded:
if (recognizer.isClick && !recognizer.isLongPress) {
[mediaPlayer performNavigationAction:VLCMediaPlaybackNavigationActionActivate];
} else {
switch (recognizer.touchLocation) {
case VLCSiriRemoteTouchLocationLeft:
......@@ -434,11 +449,6 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
}
}
break;
case UIGestureRecognizerStateEnded:
if (recognizer.isClick && !recognizer.isLongPress) {
[mediaPlayer performNavigationAction:VLCMediaPlaybackNavigationActionActivate];
}
break;
default:
break;
}
......@@ -725,6 +735,16 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
}
- (void)showPlaybackControlsIfNeededForUserInteraction
{
VLCMediaPlayer *mediaPlayer = [VLCPlaybackController sharedInstance].mediaPlayer;
NSInteger currentTitle = mediaPlayer.currentTitleIndex;
NSArray *titles = mediaPlayer.titleDescriptions;
if (currentTitle < titles.count) {
NSDictionary *title = titles[currentTitle];
if ([[title objectForKey:VLCTitleDescriptionIsMenu] boolValue]) {
return;
}
}
if (self.bottomOverlayView.alpha == 0.0) {
[self animatePlaybackControlsToVisibility:YES];
}
......
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