2016-03-31 23:10:25 +02:00
|
|
|
#import "RCTVideoPlayerViewController.h"
|
|
|
|
|
|
|
|
@interface RCTVideoPlayerViewController ()
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation RCTVideoPlayerViewController
|
|
|
|
|
2018-10-09 16:01:41 -07:00
|
|
|
- (BOOL)shouldAutorotate {
|
2018-10-18 15:21:46 -07:00
|
|
|
|
|
|
|
if (self.autorotate || self.preferredOrientation.lowercaseString == nil || [self.preferredOrientation.lowercaseString isEqualToString:@"all"])
|
2018-10-09 16:01:41 -07:00
|
|
|
return YES;
|
|
|
|
|
|
|
|
return NO;
|
2018-08-09 09:58:03 -07:00
|
|
|
}
|
|
|
|
|
2016-04-01 10:51:31 +02:00
|
|
|
- (void)viewDidDisappear:(BOOL)animated
|
2016-03-31 23:10:25 +02:00
|
|
|
{
|
2018-06-02 14:55:55 +02:00
|
|
|
[super viewDidDisappear:animated];
|
|
|
|
[_rctDelegate videoPlayerViewControllerWillDismiss:self];
|
|
|
|
[_rctDelegate videoPlayerViewControllerDidDismiss:self];
|
2016-03-31 23:10:25 +02:00
|
|
|
}
|
|
|
|
|
2018-10-09 16:01:41 -07:00
|
|
|
#if !TARGET_OS_TV
|
2018-08-02 10:32:50 -07:00
|
|
|
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
|
2018-08-09 09:58:03 -07:00
|
|
|
return UIInterfaceOrientationMaskAll;
|
2018-08-02 10:32:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
|
2018-08-09 09:58:03 -07:00
|
|
|
if ([self.preferredOrientation.lowercaseString isEqualToString:@"landscape"]) {
|
2018-08-20 11:52:06 -07:00
|
|
|
return UIInterfaceOrientationLandscapeRight;
|
2018-08-09 09:58:03 -07:00
|
|
|
}
|
|
|
|
else if ([self.preferredOrientation.lowercaseString isEqualToString:@"portrait"]) {
|
|
|
|
return UIInterfaceOrientationPortrait;
|
|
|
|
}
|
|
|
|
else { // default case
|
|
|
|
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
|
|
|
return orientation;
|
|
|
|
}
|
2018-08-02 10:32:50 -07:00
|
|
|
}
|
2018-10-09 16:01:41 -07:00
|
|
|
#endif
|
2018-08-02 10:32:50 -07:00
|
|
|
|
2016-03-31 23:10:25 +02:00
|
|
|
@end
|