Skip to content

Commit

Permalink
New code for red progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
PoomSmart committed Apr 6, 2024
1 parent 0ff17ca commit c827624
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Sources/uYouPlus.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#import "uYouPlusThemes.h" // Hide "Buy Super Thanks" banner (_ASDisplayView)
#import <YouTubeHeader/YTAppDelegate.h> // Activate FLEX
#import <YouTubeHeader/YTIMenuConditionalServiceItemRenderer.h>
#import <YouTubeHeader/YTIPlayerBarDecorationModel.h>
#import <YouTubeHeader/YTPlayerBarRectangleDecorationView.h>

// Hide buttons under the video player by @PoomSmart
#import <YouTubeHeader/ASCollectionElement.h>
Expand Down
16 changes: 15 additions & 1 deletion Sources/uYouPlus.xm
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,27 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
}
%end

// Bring back the red progress bar - Broken?!
// Bring back the red progress bar - old versions
%hook YTInlinePlayerBarContainerView
- (id)quietProgressBarColor {
return IS_ENABLED(@"redProgressBar_enabled") ? [UIColor redColor] : %orig;
}
%end

// Bring back the red progress bar - new versions
%hook YTPlayerBarRectangleDecorationView
- (void)drawRectangleDecorationWithSideMasks:(CGRect)rect {
if (IS_ENABLED(@"redProgressBar_enabled")) {
YTIPlayerBarDecorationModel *model = [self valueForKey:@"_model"];
int overlayMode = model.playingState.overlayMode;
model.playingState.overlayMode = 1;
%orig;
model.playingState.overlayMode = overlayMode;
} else
%orig;
}
%end

// Hide videos' end screens
// See YTNoHoverCards.x

Expand Down

0 comments on commit c827624

Please sign in to comment.