Skip to content

Commit

Permalink
Merge pull request qnblackcat#592 from bhackel/fix/hide-prev-next-but…
Browse files Browse the repository at this point in the history
…tons

Fix: Hide Prev/Next Buttons, Snap to Chapter, Disable 2-finger double tap to skip chapter
  • Loading branch information
arichornlover authored May 3, 2024
2 parents f0cc5be + 540d5f2 commit 8d6f3cf
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
5 changes: 5 additions & 0 deletions Sources/uYouPlus.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
40 changes: 25 additions & 15 deletions Sources/uYouPlus.xm
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -725,7 +735,7 @@ BOOL isAd(YTIElementRenderer *self) {
}
}
%end
*/


// Disable Pinch to zoom
%hook YTColdConfig
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1468,9 +1478,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *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);
}
Expand Down
5 changes: 3 additions & 2 deletions Sources/uYouPlusSettings.xm
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -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");
Expand Down

0 comments on commit 8d6f3cf

Please sign in to comment.