mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-19 09:52:05 +00:00
Create BigYTMiniPlayer.xm
This commit is contained in:
parent
82baaeb8bb
commit
5900b0a5ce
1 changed files with 31 additions and 0 deletions
31
Sources/BigYTMiniPlayer.xm
Normal file
31
Sources/BigYTMiniPlayer.xm
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#import "BigYTMiniPlayer.h"
|
||||
|
||||
%group BigYTMiniPlayer // https://github.com/Galactic-Dev/BigYTMiniPlayer
|
||||
%hook YTWatchMiniBarView
|
||||
- (void)setWatchMiniPlayerLayout:(int)arg1 {
|
||||
%orig(1);
|
||||
}
|
||||
- (int)watchMiniPlayerLayout {
|
||||
return 1;
|
||||
}
|
||||
- (void)layoutSubviews {
|
||||
%orig;
|
||||
self.frame = CGRectMake(([UIScreen mainScreen].bounds.size.width - self.frame.size.width), self.frame.origin.y, self.frame.size.width, self.frame.size.height);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTMainAppVideoPlayerOverlayView
|
||||
- (BOOL)isUserInteractionEnabled {
|
||||
if([[self _viewControllerForAncestor].parentViewController.parentViewController isKindOfClass:%c(YTWatchMiniBarViewController)]) {
|
||||
return NO;
|
||||
}
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
%ctor {
|
||||
if (IS_ENABLED(@"bigYTMiniPlayer_enabled") && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) {
|
||||
%init(BigYTMiniPlayer);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue