Browse Source

tvOS playback: iterate on menu navigation

Felix Paul Kühne 9 years ago
parent
commit
c8a0a92fe3
1 changed files with 25 additions and 5 deletions
  1. 25 5
      Apple-TV/Playback/VLCFullscreenMovieTVViewController.m

+ 25 - 5
Apple-TV/Playback/VLCFullscreenMovieTVViewController.m

@@ -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];
     }