|
|
|
|
|
|
|
|
@end |
|
|
@end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@interface AVButton : UIView |
|
|
|
|
|
@end |
|
|
|
|
|
|
|
|
@interface AVTransportControlsView : UIView |
|
|
@interface AVTransportControlsView : UIView |
|
|
-(void)deviceOrientationDidChange; |
|
|
-(void)deviceOrientationDidChange; |
|
|
//@property (assign, nonatomic) AVButton *skipBackButton; |
|
|
|
|
|
|
|
|
@property (assign, nonatomic) AVButton *skipBackButton; |
|
|
|
|
|
@end |
|
|
|
|
|
|
|
|
|
|
|
@interface AVPlaybackControlsView |
|
|
|
|
|
@property (assign, nonatomic) AVTransportControlsView *transportControlsView; |
|
|
|
|
|
@end |
|
|
|
|
|
|
|
|
|
|
|
@interface AVPlayerViewControllerContentView |
|
|
|
|
|
@property (assign, nonatomic) AVPlaybackControlsView *playbackControlsView; |
|
|
@end |
|
|
@end |
|
|
|
|
|
|
|
|
|
|
|
@interface AVFullScreenViewController |
|
|
|
|
|
@property (assign, nonatomic) AVPlayerViewControllerContentView *contentView; |
|
|
|
|
|
@end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void); |
|
|
extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void); |
|
|
|
|
|
|
|
|
static UIButton *button = nil; |
|
|
static UIButton *button = nil; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
%hook AVFullScreenViewController |
|
|
|
|
|
-(void)viewDidLayoutSubviews{ |
|
|
|
|
|
%orig; |
|
|
|
|
|
[self.contentView.playbackControlsView.transportControlsView deviceOrientationDidChange]; |
|
|
|
|
|
} |
|
|
|
|
|
%end |
|
|
|
|
|
|
|
|
%hook SBOrientationLockManager |
|
|
%hook SBOrientationLockManager |
|
|
-(SBOrientationLockManager*)init{ |
|
|
-(SBOrientationLockManager*)init{ |
|
|
|
|
|
|
|
|
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), CFSTR("avlock.firstUpdate"), (void*)myObserver, NULL, true); |
|
|
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), CFSTR("avlock.firstUpdate"), (void*)myObserver, NULL, true); |
|
|
button.contentMode = UIViewContentModeScaleAspectFit; |
|
|
button.contentMode = UIViewContentModeScaleAspectFit; |
|
|
|
|
|
|
|
|
UIInterfaceOrientation orientation =[UIApplication sharedApplication].statusBarOrientation; |
|
|
|
|
|
if (orientation == UIInterfaceOrientationLandscapeRight || orientation == UIInterfaceOrientationLandscapeLeft){ |
|
|
|
|
|
button.frame = CGRectMake(6.5, -40, 46, 46); |
|
|
|
|
|
} |
|
|
|
|
|
else if(orientation == UIInterfaceOrientationPortrait){ |
|
|
|
|
|
button.frame = CGRectMake(([UIScreen mainScreen].bounds.size.width / 2) - 142.5, 43, 46, 46); |
|
|
|
|
|
} |
|
|
|
|
|
button.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10); |
|
|
button.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10); |
|
|
|
|
|
|
|
|
[self addSubview:button]; |
|
|
[self addSubview:button]; |
|
|
|
|
|
|
|
|
CFNotificationCenterRemoveObserver ( CFNotificationCenterGetDarwinNotifyCenter(), (void*)myObserver, NULL, NULL); |
|
|
CFNotificationCenterRemoveObserver ( CFNotificationCenterGetDarwinNotifyCenter(), (void*)myObserver, NULL, NULL); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%new |
|
|
%new |
|
|
-(void)deviceOrientationDidChange{ |
|
|
-(void)deviceOrientationDidChange{ |
|
|
UIInterfaceOrientation orientation =[UIApplication sharedApplication].statusBarOrientation; |
|
|
UIInterfaceOrientation orientation =[UIApplication sharedApplication].statusBarOrientation; |
|
|
if (orientation == UIInterfaceOrientationLandscapeRight || orientation == UIInterfaceOrientationLandscapeLeft){ |
|
|
if (orientation == UIInterfaceOrientationLandscapeRight || orientation == UIInterfaceOrientationLandscapeLeft){ |
|
|
button.frame = CGRectMake(6.5, -40, 46, 46); |
|
|
|
|
|
|
|
|
button.frame = CGRectMake(self.skipBackButton.frame.origin.x-13.5, -40, 46, 46); |
|
|
} |
|
|
} |
|
|
else if(orientation == UIInterfaceOrientationPortrait){ |
|
|
else if(orientation == UIInterfaceOrientationPortrait){ |
|
|
button.frame = CGRectMake((self.frame.size.width / 2) - 115.5, 43, 46, 46); |
|
|
|
|
|
|
|
|
button.frame = CGRectMake((self.skipBackButton.frame.origin.x - 62), self.skipBackButton.frame.origin.y, 46, 46); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|