From a6e248b2487a7df3759427d98718df7800d77706 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Fri, 3 May 2024 00:58:50 -0700 Subject: [PATCH 1/3] Re-add code --- Sources/uYouPlus.xm | 26 +++++++++++++------------- Sources/uYouPlusSettings.xm | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 0f49d3e67f..ddb18523e5 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -934,16 +934,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 +1468,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..fc03d6f6ec 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -275,7 +275,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"); From bdbe3ba428de14b2f79e8c3f1a0673293455469e Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Fri, 3 May 2024 01:57:44 -0700 Subject: [PATCH 2/3] Snap to chapter --- Sources/uYouPlus.h | 5 +++++ Sources/uYouPlus.xm | 4 ++-- Sources/uYouPlusSettings.xm | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) 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 ddb18523e5..49d9eb50ef 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -715,7 +715,7 @@ BOOL isAd(YTIElementRenderer *self) { %end %end -/* This is disabled due to "self.enableSnapToChapter" not existing. + // Disable snap to chapter %hook YTSegmentableInlinePlayerBarView - (void)didMoveToWindow { @@ -725,7 +725,7 @@ BOOL isAd(YTIElementRenderer *self) { } } %end -*/ + // Disable Pinch to zoom %hook YTColdConfig diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index fc03d6f6ec..dc1a13d196 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -254,7 +254,7 @@ 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"); From 540d5f24f2f451c38550c66460ede68daef4e63d Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Fri, 3 May 2024 01:36:31 -0700 Subject: [PATCH 3/3] Feature to disable chapter skipping --- Sources/uYouPlus.xm | 10 ++++++++++ Sources/uYouPlusSettings.xm | 1 + 2 files changed, 11 insertions(+) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 49d9eb50ef..9fa1d1c2bc 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -715,6 +715,16 @@ BOOL isAd(YTIElementRenderer *self) { %end %end +// 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 diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index dc1a13d196..7be8d78e0f 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -259,6 +259,7 @@ extern NSBundle *uYouPlusBundle(); 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"));