diff --git a/Limelight/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.m b/Limelight/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.m index cb4724c1..bac09f59 100644 --- a/Limelight/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.m +++ b/Limelight/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.m @@ -45,6 +45,18 @@ @synthesize chevronView; @synthesize chevronImageView; +- (UIInterfaceOrientationMask)getCurrentOrientation{ + CGFloat screenHeightInPoints = CGRectGetHeight([[UIScreen mainScreen] bounds]); + CGFloat screenWidthInPoints = CGRectGetWidth([[UIScreen mainScreen] bounds]); + //lock the orientation accordingly after streaming is started + if(screenWidthInPoints > screenHeightInPoints) return UIInterfaceOrientationMaskLandscape; + else return UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskPortraitUpsideDown; +} + +- (UIInterfaceOrientationMask)supportedInterfaceOrientations { + // Return the supported interface orientations acoordingly + return [self getCurrentOrientation]; // 90 Degree rotation not allowed in streaming or app view +} - (void) viewWillDisappear:(BOOL)animated{ OnScreenWidgetView.editMode = false; diff --git a/Limelight/ViewControllers/CustomOSCViewControl/OSCProfilesTableViewController.m b/Limelight/ViewControllers/CustomOSCViewControl/OSCProfilesTableViewController.m index 4e1c6750..93e95e97 100644 --- a/Limelight/ViewControllers/CustomOSCViewControl/OSCProfilesTableViewController.m +++ b/Limelight/ViewControllers/CustomOSCViewControl/OSCProfilesTableViewController.m @@ -26,6 +26,19 @@ const double NAV_BAR_HEIGHT = 50; @synthesize tableView; +- (UIInterfaceOrientationMask)getCurrentOrientation{ + CGFloat screenHeightInPoints = CGRectGetHeight([[UIScreen mainScreen] bounds]); + CGFloat screenWidthInPoints = CGRectGetWidth([[UIScreen mainScreen] bounds]); + //lock the orientation accordingly after streaming is started + if(screenWidthInPoints > screenHeightInPoints) return UIInterfaceOrientationMaskLandscape; + else return UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskPortraitUpsideDown; +} + +- (UIInterfaceOrientationMask)supportedInterfaceOrientations { + // Return the supported interface orientations acoordingly + return [self getCurrentOrientation]; // 90 Degree rotation not allowed in streaming or app view +} + - (void) viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; [[NSNotificationCenter defaultCenter] postNotificationName:@"OscLayoutTableViewCloseNotification" object:self]; // notify other view that oscLayoutManager is closing diff --git a/Limelight/ViewControllers/SWRevealViewController.m b/Limelight/ViewControllers/SWRevealViewController.m index 54ed9fe7..5213d050 100755 --- a/Limelight/ViewControllers/SWRevealViewController.m +++ b/Limelight/ViewControllers/SWRevealViewController.m @@ -733,8 +733,7 @@ const int FrontViewPositionNone = 0xff; else return UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskPortraitUpsideDown; } - -// tested on iOS17. this method does not call back on iOS14, runtime orientation limitation not working for iOS14. Probably depends on iOS16 or higher. +// tested on iOS17. - (UIInterfaceOrientationMask)supportedInterfaceOrientations { // Return the supported interface orientations acoordingly if(self.mainFrameIsInHostView){