mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 17:15:32 +00:00
Fix Remaining Time
This commit is contained in:
parent
9b5587c268
commit
2fda2189cb
2 changed files with 14 additions and 7 deletions
|
|
@ -55,6 +55,9 @@
|
|||
#define LOWCONTRASTMODE_CUTOFF_VERSION @"17.38.10" // LowContrastMode (v17.33.2-17.38.10)
|
||||
|
||||
// Always show remaining time in video player - @bhackel
|
||||
@interface YTPlayerBarController : NSObject
|
||||
@property(nonatomic, strong) YTInlinePlayerBarContainerView *playerBar;
|
||||
@end
|
||||
@interface YTInlinePlayerBarContainerView (uYouEnhanced)
|
||||
@property(nonatomic, assign) BOOL shouldDisplayTimeRemaining;
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -971,14 +971,18 @@ NSData *cellDividerData;
|
|||
%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;
|
||||
%hook YTPlayerBarController
|
||||
// When a new video is played, enable time remaining flag
|
||||
- (void)setActiveSingleVideo:(id)arg1 {
|
||||
%orig;
|
||||
if (IS_ENABLED(@"alwaysShowRemainingTime_enabled")) {
|
||||
// Get the player bar view
|
||||
YTInlinePlayerBarContainerView *playerBar = self.playerBar;
|
||||
if (playerBar) {
|
||||
// Enable the time remaining flag
|
||||
playerBar.shouldDisplayTimeRemaining = YES;
|
||||
}
|
||||
}
|
||||
return playerBar;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue