mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-05-18 02:41:58 +00:00
Merge pull request #611 from bhackel/fix/keep-remaining-time
Fix/Remaining Time
This commit is contained in:
commit
524c6a4611
3 changed files with 32 additions and 8 deletions
|
|
@ -55,6 +55,9 @@
|
||||||
#define LOWCONTRASTMODE_CUTOFF_VERSION @"17.38.10" // LowContrastMode (v17.33.2-17.38.10)
|
#define LOWCONTRASTMODE_CUTOFF_VERSION @"17.38.10" // LowContrastMode (v17.33.2-17.38.10)
|
||||||
|
|
||||||
// Always show remaining time in video player - @bhackel
|
// Always show remaining time in video player - @bhackel
|
||||||
|
@interface YTPlayerBarController : NSObject
|
||||||
|
@property(nonatomic, strong) YTInlinePlayerBarContainerView *playerBar;
|
||||||
|
@end
|
||||||
@interface YTInlinePlayerBarContainerView (uYouEnhanced)
|
@interface YTInlinePlayerBarContainerView (uYouEnhanced)
|
||||||
@property(nonatomic, assign) BOOL shouldDisplayTimeRemaining;
|
@property(nonatomic, assign) BOOL shouldDisplayTimeRemaining;
|
||||||
@end
|
@end
|
||||||
|
|
|
||||||
|
|
@ -971,14 +971,34 @@ NSData *cellDividerData;
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// Always use remaining time in the video player - @bhackel
|
// Always use remaining time in the video player - @bhackel
|
||||||
%hook YTInlinePlayerBarContainerView
|
%hook YTPlayerBarController
|
||||||
// Modify constructor to enable the feature when it is done
|
// When a new video is played, enable time remaining flag
|
||||||
- (instancetype)init {
|
- (void)setActiveSingleVideo:(id)arg1 {
|
||||||
YTInlinePlayerBarContainerView *playerBar = (YTInlinePlayerBarContainerView *)%orig;
|
%orig;
|
||||||
if (playerBar && IS_ENABLED(@"alwaysShowRemainingTime_enabled")) {
|
if (IS_ENABLED(@"alwaysShowRemainingTime_enabled")) {
|
||||||
playerBar.shouldDisplayTimeRemaining = YES;
|
// Get the player bar view
|
||||||
|
YTInlinePlayerBarContainerView *playerBar = self.playerBar;
|
||||||
|
if (playerBar) {
|
||||||
|
// Enable the time remaining flag
|
||||||
|
playerBar.shouldDisplayTimeRemaining = YES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return playerBar;
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Disable toggle time remaining - @bhackel
|
||||||
|
%hook YTInlinePlayerBarContainerView
|
||||||
|
- (void)setShouldDisplayTimeRemaining:(BOOL)arg1 {
|
||||||
|
if (IS_ENABLED(@"disableRemainingTime_enabled")) {
|
||||||
|
// Set true if alwaysShowRemainingTime
|
||||||
|
if (IS_ENABLED(@"alwaysShowRemainingTime_enabled")) {
|
||||||
|
%orig(YES);
|
||||||
|
} else {
|
||||||
|
%orig(NO);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
%orig;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -319,7 +319,8 @@ extern NSBundle *uYouPlusBundle();
|
||||||
SWITCH_ITEM2(LOC(@"STOCK_VOLUME_HUD"), LOC(@"STOCK_VOLUME_HUD_DESC"), @"stockVolumeHUD_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_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_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");
|
SWITCH_ITEM(LOC(@"Always use remaining time"), LOC(@"Change the default to show time remaining in the player bar"), @"alwaysShowRemainingTime_enabled");
|
||||||
|
SWITCH_ITEM(LOC(@"Disable toggle time remaining"), LOC(@"Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."), @"disableRemainingTime_enabled");
|
||||||
|
|
||||||
# pragma mark - Video controls overlay options
|
# pragma mark - Video controls overlay options
|
||||||
SECTION_HEADER(LOC(@"VIDEO_PLAYER_OPTIONS"));
|
SECTION_HEADER(LOC(@"VIDEO_PLAYER_OPTIONS"));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue