Switch gesture placement location

This commit is contained in:
Bryce Hackel 2024-09-04 00:50:25 -07:00
parent b9edf2bccd
commit 0d3dfbe2c7
No known key found for this signature in database
GPG key ID: F031960F08455E88
2 changed files with 15 additions and 5 deletions

View file

@ -49,6 +49,7 @@
#import "Tweaks/YouTubeHeader/YTPageStyleController.h"
#import "Tweaks/YouTubeHeader/YTRightNavigationButtons.h"
#import "Tweaks/YouTubeHeader/YTInlinePlayerBarView.h"
#import "Tweaks/YouTubeHeader/YTMainAppVideoPlayerOverlayView.h"
#define LOC(x) [tweakBundle localizedStringForKey:x value:nil table:nil]
#define YT_BUNDLE_ID @"com.google.ios.youtube"
@ -165,7 +166,7 @@ typedef NS_ENUM(NSUInteger, GestureSection) {
@end
@interface YTFineScrubberFilmstripCollectionView : UICollectionView
@end
@interface YTPlayerViewController (YTLitePlus) <UIGestureRecognizerDelegate>
@interface YTPlayerViewController (YTLitePlusGestures) <UIGestureRecognizerDelegate>
@property (nonatomic, retain) UIPanGestureRecognizer *YTLitePlusPanGesture;
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
@end
@ -174,16 +175,20 @@ typedef NS_ENUM(NSUInteger, GestureSection) {
@interface MPVolumeController : NSObject
@property (nonatomic, assign, readwrite) float volumeValue;
@end
@interface YTPlayerBarController (YTLitePlus)
@interface YTPlayerBarController (YTLitePlusGestures)
- (void)didScrub:(UIPanGestureRecognizer *)gestureRecognizer;
- (void)startScrubbing;
- (void)didScrubToPoint:(CGPoint)point;
- (void)endScrubbingForSeekSource:(int)seekSource;
@end
@interface YTMainAppVideoPlayerOverlayViewController (YTLitePlus)
@interface YTMainAppVideoPlayerOverlayViewController (YTLitePlusGestures)
@property (nonatomic, strong, readwrite) YTPlayerBarController *playerBarController;
@property YTMainAppVideoPlayerOverlayView *videoPlayerOverlayView;
@end
@interface YTInlinePlayerBarContainerView (YTLitePlus)
@interface YTMainAppVideoPlayerOverlayView (YTLitePlusGestures)
@property YTMainAppControlsOverlayView *controlsOverlayView;
@end
@interface YTInlinePlayerBarContainerView (YTLitePlusGestures)
@property UIPanGestureRecognizer *scrubGestureRecognizer;
@property (nonatomic, strong, readwrite) YTFineScrubberFilmstripView *fineScrubberFilmstrip;
- (CGFloat)scrubXForScrubRange:(CGFloat)scrubRange;

View file

@ -712,7 +712,12 @@ BOOL isTabSelected = NO;
playerViewController.YTLitePlusPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:playerViewController
action:@selector(YTLitePlusHandlePanGesture:)];
playerViewController.YTLitePlusPanGesture.delegate = playerViewController;
[playerViewController.playerView addGestureRecognizer:playerViewController.YTLitePlusPanGesture];
// Place the gesture on the Main App Controls Overlay View, which scales with the video player
// when, for instance, opening the Live Chat side panel in fullscreen
YTMainAppVideoPlayerOverlayViewController *mainVideoPlayerController = (YTMainAppVideoPlayerOverlayViewController *)playerViewController.childViewControllers.firstObject;
YTMainAppVideoPlayerOverlayView *mainVideoPlayerView = mainVideoPlayerController.videoPlayerOverlayView;
YTMainAppControlsOverlayView *controlsOverlayView = mainVideoPlayerView.controlsOverlayView;
[controlsOverlayView addGestureRecognizer:playerViewController.YTLitePlusPanGesture];
}
}
%orig;