mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-21 11:52:00 +00:00
Allow feature for portrait videos
This commit is contained in:
parent
cc38d49f2e
commit
a43f8ff13e
2 changed files with 31 additions and 4 deletions
|
|
@ -30,6 +30,7 @@
|
||||||
#import <YouTubeHeader/YTInnerTubeCollectionViewController.h>
|
#import <YouTubeHeader/YTInnerTubeCollectionViewController.h>
|
||||||
#import <YouTubeHeader/YTPivotBarItemView.h>
|
#import <YouTubeHeader/YTPivotBarItemView.h>
|
||||||
#import <YouTubeHeader/YTCollectionViewCell.h>
|
#import <YouTubeHeader/YTCollectionViewCell.h>
|
||||||
|
#import <YouTubeHeader/YTWatchViewController.h>
|
||||||
|
|
||||||
// Hide buttons under the video player by @PoomSmart
|
// Hide buttons under the video player by @PoomSmart
|
||||||
#import <YouTubeHeader/ASCollectionElement.h>
|
#import <YouTubeHeader/ASCollectionElement.h>
|
||||||
|
|
@ -67,6 +68,15 @@
|
||||||
@property(readonly, nonatomic) YTIIcon *iconImage;
|
@property(readonly, nonatomic) YTIIcon *iconImage;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
// Disable Pull to Full for landscape videos - @bhackel
|
||||||
|
@interface YTWatchPullToFullController : NSObject
|
||||||
|
@property(nonatomic, strong) YTWatchViewController *playerViewSource;
|
||||||
|
@end
|
||||||
|
@interface YTWatchViewController (uYouEnhanced)
|
||||||
|
@property(nonatomic, strong) YTWatchPullToFullController *pullToFullController;
|
||||||
|
- (NSUInteger)allowedFullScreenOrientations;
|
||||||
|
@end
|
||||||
|
|
||||||
// uYouPlus
|
// uYouPlus
|
||||||
@interface YTHeaderLogoController : UIView
|
@interface YTHeaderLogoController : UIView
|
||||||
@property(readonly, nonatomic) long long pageStyle;
|
@property(readonly, nonatomic) long long pageStyle;
|
||||||
|
|
|
||||||
|
|
@ -657,12 +657,29 @@ BOOL isAd(YTIElementRenderer *self) {
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// Disable pull to enter vertical fullscreen gesture - @bhackel
|
// Disable pull to enter vertical/portrait fullscreen gesture - @bhackel
|
||||||
// This was introduced in version 19.XX
|
// This was introduced in version 19.XX
|
||||||
|
// This only applies to landscape videos
|
||||||
%group gDisablePullToFull
|
%group gDisablePullToFull
|
||||||
%hook YTColdConfig
|
%hook YTWatchPullToFullController
|
||||||
- (BOOL)enablePullToFull { return NO; }
|
// New variable to store the controller
|
||||||
- (BOOL)enablePullToFullAlwaysExitFullscreenLandscape { return NO; }
|
- (BOOL)shouldRecognizeOverscrollEventsFromWatchOverscrollController:(id)arg1 {
|
||||||
|
NSLog(@"bhackel - shouldRecognizeOverscrollEventsFromWatchOverscrollController");
|
||||||
|
// Get the current player orientation
|
||||||
|
YTWatchViewController *watchViewController = self.playerViewSource;
|
||||||
|
NSUInteger allowedFullScreenOrientations = [watchViewController allowedFullScreenOrientations];
|
||||||
|
NSLog(@"bhackel - current orientation: %lu", allowedFullScreenOrientations);
|
||||||
|
// Check if the current player orientation is portrait
|
||||||
|
if (allowedFullScreenOrientations == UIInterfaceOrientationMaskAllButUpsideDown
|
||||||
|
|| allowedFullScreenOrientations == UIInterfaceOrientationMaskPortrait
|
||||||
|
|| allowedFullScreenOrientations == UIInterfaceOrientationMaskPortraitUpsideDown) {
|
||||||
|
NSLog(@"bhackel - allow pull to full: YES");
|
||||||
|
return %orig;
|
||||||
|
} else {
|
||||||
|
NSLog(@"bhackel - allow pull to full: NO");
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
%end
|
%end
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue