Add always show remaining time

This commit is contained in:
Bryce Hackel 2024-05-05 13:26:07 -07:00
parent 8d6f3cf55c
commit a50a24e4a6
No known key found for this signature in database
GPG key ID: F031960F08455E88
3 changed files with 19 additions and 0 deletions

View file

@ -53,6 +53,11 @@
#define DEFAULT_RATE 1.0f // YTSpeed
#define LOWCONTRASTMODE_CUTOFF_VERSION @"17.38.10" // LowContrastMode (v17.33.2-17.38.10)
// Always show remaining time in video player - @bhackel
@interface YTInlinePlayerBarContainerView (uYouEnhanced)
@property(nonatomic, assign) BOOL shouldDisplayTimeRemaining;
@end
// IAmYouTube
@interface SSOConfiguration : NSObject
@end

View file

@ -944,6 +944,19 @@ BOOL isAd(YTIElementRenderer *self) {
}
%end
// Always use remaining time in the video player - @bhackel
%hook YTInlinePlayerBarContainerView
// Modify constructor to enable the feature when it is done
- (instancetype)init {
YTInlinePlayerBarContainerView *playerBar = (YTInlinePlayerBarContainerView *)%orig;
if (playerBar && IS_ENABLED(@"alwaysShowRemainingTime_enabled")) {
playerBar.shouldDisplayTimeRemaining = YES;
}
return playerBar;
}
%end
// Hide previous and next buttons in all videos - @bhackel
%group gHidePreviousAndNextButton
%hook YTColdConfig
- (BOOL)removeNextPaddleForAllVideos {

View file

@ -260,6 +260,7 @@ extern NSBundle *uYouPlusBundle();
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");
SWITCH_ITEM2(LOC(@"Always use remaining time"), LOC(@"Change the default to show time remaining in the player bar"), @"alwaysShowRemainingTime_enabled");
# pragma mark - Video controls overlay options
SECTION_HEADER(LOC(@"VIDEO_PLAYER_OPTIONS"));