Add YTTapToSeek

This commit is contained in:
Bryce Hackel 2024-07-07 00:19:46 -07:00
parent 0369070984
commit 93f75c7d7e
No known key found for this signature in database
GPG key ID: F031960F08455E88
14 changed files with 63 additions and 1 deletions

View file

@ -117,7 +117,8 @@ static const NSInteger YTLiteSection = 789;
BASIC_SWITCH(LOC(@"HIDE_SHADOW_OVERLAY_BUTTONS"), LOC(@"HIDE_SHADOW_OVERLAY_BUTTONS_DESC"), @"hideVideoPlayerShadowOverlayButtons_enabled"),
BASIC_SWITCH(LOC(@"HIDE_RIGHT_PANEL"), LOC(@"HIDE_RIGHT_PANEL_DESC"), @"hideRightPanel_enabled"),
BASIC_SWITCH(LOC(@"HIDE_HEATWAVES"), LOC(@"HIDE_HEATWAVES_DESC"), @"hideHeatwaves_enabled"),
BASIC_SWITCH(LOC(@"SEEK_ANYWHERE"), LOC(@"SEEK_ANYWHERE_DESC"), @"seekAnywhere_enabled")
BASIC_SWITCH(LOC(@"SEEK_ANYWHERE"), LOC(@"SEEK_ANYWHERE_DESC"), @"seekAnywhere_enabled"),
BASIC_SWITCH(LOC(@"ENABLE_TAP_TO_SEEK"), LOC(@"ENABLE_TAP_TO_SEEK_DESC"), @"YTTapToSeek_enabled")
];
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"VIDEO_CONTROLS_OVERLAY_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
[settingsViewController pushViewController:picker];

View file

@ -424,6 +424,28 @@ BOOL isTabSelected = NO;
}
%end
// YTTapToSeek - https://github.com/bhackel/YTTapToSeek
%group gYTTapToSeek
%hook YTInlinePlayerBarContainerView
- (void)didPressScrubber:(id)arg1 {
%orig;
// Get access to the seekToTime method
YTMainAppVideoPlayerOverlayViewController *mainAppController = [self.delegate valueForKey:@"_delegate"];
YTPlayerViewController *playerViewController = [mainAppController valueForKey:@"parentViewController"];
// Get the X position of this tap from arg1
UIGestureRecognizer *gestureRecognizer = (UIGestureRecognizer *)arg1;
CGPoint location = [gestureRecognizer locationInView:self];
CGFloat x = location.x;
// Get the associated proportion of time using scrubRangeForScrubX
double timestampFraction = [self scrubRangeForScrubX:x];
// Get the timestamp from the fraction
double timestamp = [mainAppController totalTime] * timestampFraction;
// Jump to the timestamp
[playerViewController seekToTime:timestamp];
}
%end
%end
// BigYTMiniPlayer: https://github.com/Galactic-Dev/BigYTMiniPlayer
%group Main
%hook YTWatchMiniBarView
@ -621,6 +643,9 @@ BOOL isTabSelected = NO;
if (IsEnabled(@"fixCasting_enabled")) {
%init(gFixCasting);
}
if (IsEnabled(@"YTTapToSeek_enabled")) {
%init(gYTTapToSeek);
}
// Change the default value of some options
NSArray *allKeys = [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys];

View file

@ -23,6 +23,9 @@
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// App settings overlay options
"APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options";

View file

@ -23,6 +23,9 @@
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// App settings overlay options
"APP_SETTINGS_OVERLAY_OPTIONS" = "Overlay-Optionen für App-Einstellungen";

View file

@ -23,6 +23,9 @@
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// App settings overlay options
"APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options";

View file

@ -23,6 +23,9 @@
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// App settings overlay options
"APP_SETTINGS_OVERLAY_OPTIONS" = "Opciones de superposición de los ajustes de la aplicación";

View file

@ -23,6 +23,9 @@
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// App settings overlay options
"APP_SETTINGS_OVERLAY_OPTIONS" = "Paramètres des options d'overlay de l'application";

View file

@ -23,6 +23,9 @@
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// App settings overlay options
"APP_SETTINGS_OVERLAY_OPTIONS" = "アプリの設定オーバーレイの設定";

View file

@ -23,6 +23,9 @@
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// App settings overlay options
"APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options";

View file

@ -23,6 +23,9 @@
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// App settings overlay options
"APP_SETTINGS_OVERLAY_OPTIONS" = "Opțiuni Overlay Setări Aplicație";

View file

@ -23,6 +23,9 @@
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// App settings overlay options
"APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options";

View file

@ -38,6 +38,9 @@ https://github.com/PoomSmart/Return-YouTube-Dislikes/tree/main/layout/Library/Ap
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// App settings overlay options
"APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options";

View file

@ -23,6 +23,9 @@
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// App settings overlay options
"APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options";

View file

@ -32,6 +32,9 @@
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";
"ENABLE_TAP_TO_SEEK" = "Enable Tap To Seek";
"ENABLE_TAP_TO_SEEK_DESC" = "Jump to anywhere in a video by single-tapping the seek bar";
// Shorts controls overlay options
"SHORTS_CONTROLS_OVERLAY_OPTIONS" = "Tùy chọn lớp phủ điều khiển quần short";