We are programmatically changing the orientation to landscape whenever we start playing the video. The functionality working fine iPhone and same code not working only in iPad pro 12.9 inch devices.
code:
UIApplication.SharedApplication.SetStatusBarOrientation(UIInterfaceOrientation.LandscapeRight,false);
UIDevice.CurrentDevice.SetValueForKey(new NSNumber((int)UIInterfaceOrientation.LandscapeRight), new NSString("orientation"));
UIViewController.AttemptRotationToDeviceOrientation();
Appdelegate:
[Export("application:supportedInterfaceOrientationsForWindow:")]
public UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, IntPtr forWindow)
{
if (this.RestrictRotation == 1)
{
return UIInterfaceOrientationMask.Portrait;
}
else if (this.RestrictRotation == 2)
{
return UIInterfaceOrientationMask.Landscape;
}
else if (this.RestrictRotation == 3)
{
return UIInterfaceOrientationMask.All;
}
return UIInterfaceOrientationMask.Portrait;
}
Language: Xamarin