mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 21:26:04 +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/YTPivotBarItemView.h>
|
||||
#import <YouTubeHeader/YTCollectionViewCell.h>
|
||||
#import <YouTubeHeader/YTWatchViewController.h>
|
||||
|
||||
// Hide buttons under the video player by @PoomSmart
|
||||
#import <YouTubeHeader/ASCollectionElement.h>
|
||||
|
|
@ -67,6 +68,15 @@
|
|||
@property(readonly, nonatomic) YTIIcon *iconImage;
|
||||
@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
|
||||
@interface YTHeaderLogoController : UIView
|
||||
@property(readonly, nonatomic) long long pageStyle;
|
||||
|
|
|
|||
|
|
@ -657,12 +657,29 @@ BOOL isAd(YTIElementRenderer *self) {
|
|||
}
|
||||
%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 only applies to landscape videos
|
||||
%group gDisablePullToFull
|
||||
%hook YTColdConfig
|
||||
- (BOOL)enablePullToFull { return NO; }
|
||||
- (BOOL)enablePullToFullAlwaysExitFullscreenLandscape { return NO; }
|
||||
%hook YTWatchPullToFullController
|
||||
// New variable to store the controller
|
||||
- (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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue