This commit is contained in:
dayanch96
2024-03-07 18:03:24 +03:00
parent d2989b3f90
commit 1991a9d6ee
6 changed files with 20 additions and 16 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ endif
DEBUG=0
FINALPACKAGE=1
ARCHS = arm64
PACKAGE_VERSION = 3.0
PACKAGE_VERSION = 3.0.1
TARGET := iphone:clang:latest:13.0
include $(THEOS)/makefiles/common.mk
-1
View File
@@ -213,7 +213,6 @@
@end
@interface YTSegmentableInlinePlayerBarView : UIView
@property (nonatomic, assign, readonly) CGFloat totalTime;
@property (nonatomic, assign, readwrite) BOOL enableSnapToChapter;
@end
+16 -13
View File
@@ -411,6 +411,20 @@ void addEndTime(YTPlayerViewController *self, YTSingleVideoController *video, YT
}
}
void autoSkipShorts(YTPlayerViewController *self, YTSingleVideoController *video, YTSingleVideoTime *time) {
if (!ytlBool(@"autoSkipShorts")) return;
if (floor(time.time) >= floor(video.totalMediaTime)) {
if ([self.parentViewController isKindOfClass:%c(YTShortsPlayerViewController)]) {
YTShortsPlayerViewController *shortsVC = (YTShortsPlayerViewController *)self.parentViewController;
if ([shortsVC respondsToSelector:@selector(reelContentViewRequestsAdvanceToNextVideo:)]) {
[shortsVC performSelector:@selector(reelContentViewRequestsAdvanceToNextVideo:)];
}
}
}
}
%hook YTPlayerViewController
- (void)loadWithPlayerTransition:(id)arg1 playbackConfig:(id)arg2 {
%orig;
@@ -520,12 +534,14 @@ void addEndTime(YTPlayerViewController *self, YTSingleVideoController *video, YT
%orig;
addEndTime(self, video, time);
autoSkipShorts(self, video, time);
}
- (void)potentiallyMutatedSingleVideo:(YTSingleVideoController *)video currentVideoTimeDidChange:(YTSingleVideoTime *)time {
%orig;
addEndTime(self, video, time);
autoSkipShorts(self, video, time);
}
%end
@@ -844,19 +860,6 @@ static BOOL isOverlayShown = YES;
}
%end
%hook YTSegmentableInlinePlayerBarView
- (void)setScrubberTime:(CGFloat)time {
%orig;
if (ytlBool(@"autoSkipShorts") && round(time) == round(self.totalTime)) {
UIWindow *mainWindow = [UIApplication sharedApplication].windows.firstObject;
YTAppViewController *appVC = (YTAppViewController *)mainWindow.rootViewController;
[appVC.pivotBarViewController.scrubberDelegate performSelector:@selector(reelContentViewRequestsAdvanceToNextVideo:)];
}
}
%end
static void downloadImageFromURL(UIResponder *responder, NSURL *URL, BOOL download) {
NSString *URLString = URL.absoluteString;
+2
View File
@@ -7,3 +7,5 @@ Description: Lightweight YouTube Enhancer
Maintainer: dvntm
Author: dvntm
Section: Tweaks
Icon: https://raw.githubusercontent.com/dayanch96/icons/main/ytlite.png
SileoDepiction: https://raw.githubusercontent.com/dayanch96/icons/main/ytlite.json
Binary file not shown.
Binary file not shown.