2016-03-31 15:10:25 -06:00
|
|
|
#import "RCTVideoPlayerViewController.h"
|
|
|
|
|
|
|
|
@interface RCTVideoPlayerViewController ()
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation RCTVideoPlayerViewController
|
|
|
|
|
2018-08-09 10:58:03 -06:00
|
|
|
- (id)init {
|
|
|
|
self = [super init];
|
|
|
|
if (self) {
|
2018-08-20 12:52:06 -06:00
|
|
|
self.autorotate = true; // autorotate should be true by default
|
2018-08-09 10:58:03 -06:00
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2016-04-01 02:51:31 -06:00
|
|
|
- (void)viewDidDisappear:(BOOL)animated
|
2016-03-31 15:10:25 -06:00
|
|
|
{
|
2018-06-02 06:55:55 -06:00
|
|
|
[super viewDidDisappear:animated];
|
|
|
|
[_rctDelegate videoPlayerViewControllerWillDismiss:self];
|
|
|
|
[_rctDelegate videoPlayerViewControllerDidDismiss:self];
|
2016-03-31 15:10:25 -06:00
|
|
|
}
|
|
|
|
|
2018-08-02 11:32:50 -06:00
|
|
|
- (BOOL)shouldAutorotate {
|
2018-08-09 10:58:03 -06:00
|
|
|
return self.autorotate;
|
2018-08-02 11:32:50 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
|
|
|
|
|
2018-08-20 12:52:06 -06:00
|
|
|
if ([self.preferredOrientation.lowercaseString isEqualToString:@"landscape"]) {
|
|
|
|
return UIInterfaceOrientationMaskLandscape;
|
|
|
|
}
|
|
|
|
else if ([self.preferredOrientation.lowercaseString isEqualToString:@"portrait"]) {
|
|
|
|
return UIInterfaceOrientationMaskPortrait;
|
|
|
|
}
|
2018-08-09 10:58:03 -06:00
|
|
|
return UIInterfaceOrientationMaskAll;
|
2018-08-02 11:32:50 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
|
2018-08-09 10:58:03 -06:00
|
|
|
if ([self.preferredOrientation.lowercaseString isEqualToString:@"landscape"]) {
|
2018-08-20 12:52:06 -06:00
|
|
|
return UIInterfaceOrientationLandscapeRight;
|
2018-08-09 10:58:03 -06:00
|
|
|
}
|
|
|
|
else if ([self.preferredOrientation.lowercaseString isEqualToString:@"portrait"]) {
|
|
|
|
return UIInterfaceOrientationPortrait;
|
|
|
|
}
|
|
|
|
else { // default case
|
|
|
|
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
|
|
|
return orientation;
|
|
|
|
}
|
2018-08-02 11:32:50 -06:00
|
|
|
}
|
|
|
|
|
2016-03-31 15:10:25 -06:00
|
|
|
@end
|