Open Charith1990 opened 8 years ago
use this methode
(void)orientationChanged:(NSNotification)notification { UIDevice device = [UIDevice currentDevice];
if(device.orientation == UIDeviceOrientationLandscapeLeft || device.orientation == UIDeviceOrientationLandscapeRight) { _screenRect = [[UIScreen mainScreen] bounds].size; _screenHeight = _screenRect.height; _screenWidth = _screenRect.width;
self.frame = CGRectMake(0, 0, self.screenWidth, self.screenHeight);
} else if(device.orientation == UIDeviceOrientationPortrait) { self.frame = _prevFrame; } else if (device.orientation == UIDeviceOrientationPortraitUpsideDown) { [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIInterfaceOrientationPortrait] forKey:@"orientation"];
((AppDelegate*)[[UIApplication sharedApplication] delegate]).videoIsInFullscreen = NO;
// [self supportedInterfaceOrientations];
[self shouldAutorotate:UIInterfaceOrientationPortrait];
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
} }
In iOS10 after changing the playing mode to full screen, video is not center aligned and it was move to top of the screen.