From 963b9d5fd32195143addfff2fee9926760dec892 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Mon, 26 Aug 2024 00:41:55 -0700 Subject: [PATCH] Ignore fine scrubber gesture overlap --- YTLitePlus.h | 6 +++++- YTLitePlus.xm | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/YTLitePlus.h b/YTLitePlus.h index 41c1562..cc7bb43 100644 --- a/YTLitePlus.h +++ b/YTLitePlus.h @@ -154,6 +154,10 @@ typedef NS_ENUM(NSUInteger, GestureSection) { @end // Player Gestures - @bhackel +@interface YTFineScrubberFilmstripView : UIView +@end +@interface YTFineScrubberFilmstripCollectionView : UICollectionView +@end @interface YTPlayerViewController (YTLitePlus) @property (nonatomic, retain) UIPanGestureRecognizer *YTLitePlusPanGesture; - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer; @@ -174,10 +178,10 @@ typedef NS_ENUM(NSUInteger, GestureSection) { @end @interface YTInlinePlayerBarContainerView (YTLitePlus) @property UIPanGestureRecognizer *scrubGestureRecognizer; +@property (nonatomic, strong, readwrite) YTFineScrubberFilmstripView *fineScrubberFilmstrip; - (CGFloat)scrubXForScrubRange:(CGFloat)scrubRange; @end - // Hide Collapse Button - @arichornlover @interface YTMainAppControlsOverlayView (YTLitePlus) @property (nonatomic, assign, readwrite) YTQTMButton *watchCollapseButton; diff --git a/YTLitePlus.xm b/YTLitePlus.xm index bb6c372..57ff99b 100644 --- a/YTLitePlus.xm +++ b/YTLitePlus.xm @@ -977,6 +977,16 @@ BOOL isTabSelected = NO; if (otherGestureRecognizer == playerBar.scrubGestureRecognizer) { return NO; } + // Do not allow this gesture to activate with the fine scrubber gesture + YTFineScrubberFilmstripView *fineScrubberFilmstrip = playerBar.fineScrubberFilmstrip; + if (!fineScrubberFilmstrip) { + return YES; + } + YTFineScrubberFilmstripCollectionView *filmstripCollectionView = [fineScrubberFilmstrip valueForKey:@"_filmstripCollectionView"]; + if (filmstripCollectionView && otherGestureRecognizer == filmstripCollectionView.panGestureRecognizer) { + return NO; + } + } return YES; }