diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index 6b5687e60c..28eb31c288 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -57,6 +57,11 @@ @interface SSOConfiguration : NSObject @end +// Disable Snap to chapter +@interface YTSegmentableInlinePlayerBarView : UIView +@property(nonatomic, assign) BOOL enableSnapToChapter; +@end + // Hide Double tap to seek Overlay @interface YTInlinePlayerDoubleTapIndicatorView : UIView @property (nonatomic, strong) UIView *scrimOverlay; diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 0f49d3e67f..9fa1d1c2bc 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -715,7 +715,17 @@ BOOL isAd(YTIElementRenderer *self) { %end %end -/* This is disabled due to "self.enableSnapToChapter" not existing. +// Disable Double tap to skip chapter - @bhackel +%hook YTDoubleTapToSeekController +- (void)didTwoFingerDoubleTap:(id)arg1 { + if (IS_ENABLED(@"disableChapterSkip_enabled")) { + return; + } + %orig; +} +%end + + // Disable snap to chapter %hook YTSegmentableInlinePlayerBarView - (void)didMoveToWindow { @@ -725,7 +735,7 @@ BOOL isAd(YTIElementRenderer *self) { } } %end -*/ + // Disable Pinch to zoom %hook YTColdConfig @@ -934,16 +944,16 @@ BOOL isAd(YTIElementRenderer *self) { } %end -// %group gHidePreviousAndNextButton -// %hook YTColdConfig -// - (BOOL)removeNextPaddleForAllVideos { -// return YES; -// } -// - (BOOL)removePreviousPaddleForAllVideos { -// return YES; -// } -// %end -// %end +%group gHidePreviousAndNextButton +%hook YTColdConfig +- (BOOL)removeNextPaddleForAllVideos { + return YES; +} +- (BOOL)removePreviousPaddleForAllVideos { + return YES; +} +%end +%end // Hide Video Title (in Fullscreen) - @arichornlover %hook YTMainAppVideoPlayerOverlayView @@ -1468,9 +1478,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide if (IS_ENABLED(@"hideSubscriptionsNotificationBadge_enabled")) { %init(gHideSubscriptionsNotificationBadge); } - // if (IS_ENABLED(@"hidePreviousAndNextButton_enabled")) { - // %init(gHidePreviousAndNextButton); - // } + if (IS_ENABLED(@"hidePreviousAndNextButton_enabled")) { + %init(gHidePreviousAndNextButton); + } if (IS_ENABLED(@"hideOverlayDarkBackground_enabled")) { %init(gHideOverlayDarkBackground); } diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index 78f4dea19e..7be8d78e0f 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -254,11 +254,12 @@ extern NSBundle *uYouPlusBundle(); SWITCH_ITEM2(LOC(@"SLIDE_TO_SEEK"), LOC(@"SLIDE_TO_SEEK_DESC"), @"slideToSeek_enabled"); SWITCH_ITEM2(LOC(@"Enable Tap To Seek"), LOC(@"Jump to anywhere in a video by single-tapping the seek bar"), @"YTTapToSeek_enabled"); SWITCH_ITEM(LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK"), LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK_DESC"), @"doubleTapToSeek_disabled"); -// SWITCH_ITEM2(LOC(@"SNAP_TO_CHAPTER"), LOC(@"SNAP_TO_CHAPTER_DESC"), @"snapToChapter_enabled"); + SWITCH_ITEM(LOC(@"SNAP_TO_CHAPTER"), LOC(@"SNAP_TO_CHAPTER_DESC"), @"snapToChapter_enabled"); SWITCH_ITEM2(LOC(@"PINCH_TO_ZOOM"), LOC(@"PINCH_TO_ZOOM_DESC"), @"pinchToZoom_enabled"); SWITCH_ITEM(LOC(@"YT_MINIPLAYER"), LOC(@"YT_MINIPLAYER_DESC"), @"ytMiniPlayer_enabled"); SWITCH_ITEM2(LOC(@"STOCK_VOLUME_HUD"), LOC(@"STOCK_VOLUME_HUD_DESC"), @"stockVolumeHUD_enabled"); SWITCH_ITEM2(LOC(@"Disable pull-to-fullscreen gesture"), LOC(@"Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."), @"disablePullToFull_enabled"); + SWITCH_ITEM(LOC(@"Disable Double tap to skip chapter"), LOC(@"Disable the 2-finger double tap gesture that skips forward/backward by a chapter"), @"disableChapterSkip_enabled"); # pragma mark - Video controls overlay options SECTION_HEADER(LOC(@"VIDEO_PLAYER_OPTIONS")); @@ -275,7 +276,7 @@ extern NSBundle *uYouPlusBundle(); SWITCH_ITEM(LOC(@"HIDE_PAID_PROMOTION_CARDS"), LOC(@"HIDE_PAID_PROMOTION_CARDS_DESC"), @"hidePaidPromotionCard_enabled"); SWITCH_ITEM2(LOC(@"HIDE_CHANNEL_WATERMARK"), LOC(@"HIDE_CHANNEL_WATERMARK_DESC"), @"hideChannelWatermark_enabled"); SWITCH_ITEM2(LOC(@"Hide Shadow Overlay Buttons"), LOC(@"Hide the Shadow Overlay on the Play/Pause, Previous, Next, Forward & Rewind Buttons."), @"hideVideoPlayerShadowOverlayButtons_enabled"); - // SWITCH_ITEM(LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON"), LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON_DESC"), @"hidePreviousAndNextButton_enabled"); + SWITCH_ITEM2(LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON"), LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON_DESC"), @"hidePreviousAndNextButton_enabled"); SWITCH_ITEM2(LOC(@"RED_PROGRESS_BAR"), LOC(@"RED_PROGRESS_BAR_DESC"), @"redProgressBar_enabled"); SWITCH_ITEM(LOC(@"HIDE_HOVER_CARD"), LOC(@"HIDE_HOVER_CARD_DESC"), @"hideHoverCards_enabled"); SWITCH_ITEM2(LOC(@"HIDE_RIGHT_PANEL"), LOC(@"HIDE_RIGHT_PANEL_DESC"), @"hideRightPanel_enabled");