diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index 28eb31c..fbfd41e 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -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 diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 9fa1d1c..9699bb3 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -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 { diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index 7be8d78..896c137 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -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"));