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] 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 49d9eb5..9fa1d1c 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 dc1a13d..7be8d78 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"));