Added fullscreen options for iOS Player

This commit is contained in:
Ash Mishra
2018-08-09 09:58:03 -07:00
parent 3ba26eb45a
commit f45d6a2c3e
5 changed files with 159 additions and 97 deletions

View File

@@ -6,6 +6,14 @@
@implementation RCTVideoPlayerViewController
- (id)init {
self = [super init];
if (self) {
self.autorotate = false;
}
return self;
}
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
@@ -14,17 +22,25 @@
}
- (BOOL)shouldAutorotate {
return YES;
return self.autorotate;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
return UIInterfaceOrientationMaskAll;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationLandscapeLeft;
if ([self.preferredOrientation.lowercaseString isEqualToString:@"landscape"]) {
return UIInterfaceOrientationLandscapeLeft;
}
else if ([self.preferredOrientation.lowercaseString isEqualToString:@"portrait"]) {
return UIInterfaceOrientationPortrait;
}
else { // default case
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
return orientation;
}
}
@end