in mainFrameView, lock landscape orientation for iPhone, lock current orientation for iPad

Fullscreen version
This commit is contained in:
TrueZhuangjia
2025-01-28 18:59:18 +08:00
parent caa4fccabd
commit cc13b60411
4 changed files with 21 additions and 15 deletions
@@ -38,7 +38,7 @@
<attribute name="onscreenControls" attributeType="Integer 32" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
<attribute name="optimizeGames" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
<attribute name="oscLayoutToolFingers" optional="YES" attributeType="Integer 16" defaultValueString="4" usesScalarValueType="NO" syncable="YES"/>
<attribute name="oscTapExlusionAreaSize" optional="YES" attributeType="Float" defaultValueString="1.05" usesScalarValueType="NO" syncable="YES"/>
<attribute name="oscTapExlusionAreaSize" optional="YES" attributeType="Float" defaultValueString="1.03" usesScalarValueType="NO" syncable="YES"/>
<attribute name="playAudioOnPC" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
<attribute name="pointerVelocityModeDivider" optional="YES" attributeType="Float" defaultValueString="0.5" usesScalarValueType="NO" syncable="YES"/>
<attribute name="preferredCodec" attributeType="Integer 32" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
@@ -52,7 +52,7 @@
<attribute name="touchMode" optional="YES" attributeType="Integer 16" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
<attribute name="touchPointerVelocityFactor" optional="YES" attributeType="Float" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
<attribute name="uniqueId" attributeType="String" syncable="YES"/>
<attribute name="unlockDisplayOrientation" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
<attribute name="unlockDisplayOrientation" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
<attribute name="useFramePacing" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
<attribute name="width" attributeType="Integer 32" defaultValueString="1280" usesScalarValueType="NO" syncable="YES"/>
</entity>
@@ -720,6 +720,9 @@ const int FrontViewPositionNone = 0xff;
[self _setFrontViewPosition:initialPosition withDuration:0.0];
}
- (bool)isIphone{
return ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone);
}
- (UIInterfaceOrientationMask)getCurrentOrientation{
CGFloat screenHeightInPoints = CGRectGetHeight([[UIScreen mainScreen] bounds]);
@@ -732,18 +735,21 @@ const int FrontViewPositionNone = 0xff;
// tested on iOS17. this method does not call back on iOS14, runtime orientation limitation not working for iOS14. Probably depends on iOS16 or higher.
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
// Return the supported interface orientations based on the current state
// NSLog(@"supportedInterfaceOrientations called back 666");
// Return the supported interface orientations acoordingly
if(self.mainFrameIsInHostView){
if([self isIphone]) return UIInterfaceOrientationMaskLandscape; //always try to lock orientaion to landscape in mainFrameView in order to prevent bug.
else return [self getCurrentOrientation]; //always try to lock current orientaion in mainFrameView for iPad in order to prevent bug.
}
//lock the orientation accordingly after streaming is started
DataManager* dataMan = [[DataManager alloc] init];
Settings *currentSettings = [dataMan retrieveSettings];
//Handle Lock Display Orientation on & off
if(self.mainFrameIsInHostView) return [self getCurrentOrientation]; //always try to lock orientaion in mainFrameView in order to prevent bug.
if(currentSettings.unlockDisplayOrientation){
return UIInterfaceOrientationMaskAll; // 90 Degree rotation will be allowed in streaming
return UIInterfaceOrientationMaskAll; // 90 Degree rotation will be allowed in streaming or app view
}
else return [self getCurrentOrientation];
else return [self getCurrentOrientation]; // 90 Degree rotation not allowed in streaming or app view
}
+3 -3
View File
@@ -1154,19 +1154,19 @@
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "串流中允许90°转屏"
"value" : "允许90°转屏(App视图、串流时生效)"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "串流中允许90°转屏"
"value" : "允许90°转屏(App视图、串流时生效)"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "串流中允许90°转屏"
"value" : "允许90°转屏(App视图、串流时生效)"
}
}
}
+3 -3
View File
@@ -2594,19 +2594,19 @@
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "串流中允许90°转屏"
"value" : "允许90°转屏(App视图、串流时生效)"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "串流中允许90°转屏"
"value" : "允许90°转屏(App视图、串流时生效)"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "串流中允许90°转屏"
"value" : "允许90°转屏(App视图、串流时生效)"
}
}
}