소스 검색

1. 云机横屏后台逻辑优化

huangxiaodong 1 년 전
부모
커밋
5ba38f0256

+ 2 - 2
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -6158,7 +6158,7 @@
 				CODE_SIGN_ENTITLEMENTS = "隐私保护.entitlements";
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -6237,7 +6237,7 @@
 				CODE_SIGN_ENTITLEMENTS = "隐私保护.entitlements";
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

+ 2 - 1
创维盒子/双子星云手机/AppDelegate/AppDelegate.h

@@ -39,7 +39,6 @@
 @property(nonatomic,assign) BOOL  isFirstInputPwdDone;
 //与 isFirstInputPwdDone 有重复的地方 后续优化
 @property (nonatomic, assign)  BOOL isDidShowPwdType;// 是否显示密码界面了
-@property (nonatomic, assign)  BOOL isDelayedShowPwdType;// 需求延时显示密码界面了
 
 @property(nonatomic,strong) DeviceThirdIdModel *DeviceThirdIdMod;//设备的第三方信息  连接时需要
 @property(nonatomic,strong) webRtcMsgModel *DeviceWebRtcMsgMod;//设备的第三方信息  连接时需要
@@ -50,6 +49,8 @@
 @property (nonatomic, assign)BOOL isCloudPhoneModeNotPrivacyModeOpenType;//云手机模式 非隐私模式 第一次打开
 @property (nonatomic, assign)BOOL isCloudPhoneModeAndPrivacyModeOpenType;//云手机模式 并且隐私模式 第一次打开
 
+@property (nonatomic, assign)  BOOL needToPushWebRtcVCType;//云机横屏 后台 被推出来
+
 +(AppDelegate*)sharedAppDelegate;
 
 #pragma mark 更换设备 重新设置地址

+ 12 - 15
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -632,9 +632,17 @@
             
             if(vcArr.count >= 2){
                 UIViewController *curVC = vcArr.lastObject;
-                if([curVC isKindOfClass:[imageDetailsScrollViewController class]]
-                   ||[curVC isKindOfClass:[videoPlayByAVPlayerViewController class]]
-                   ||[curVC isKindOfClass:[webRtcPlayerViewController class]]){
+                
+                if([curVC isKindOfClass:[webRtcPlayerViewController class]]){
+                    webRtcPlayerViewController* vc = (webRtcPlayerViewController*)curVC;
+                    if(vc.isLan){
+                        ksharedAppDelegate.needToPushWebRtcVCType = YES;
+                        [vc exitCloudPhoneFun];
+                    }
+                }
+                else if([curVC isKindOfClass:[imageDetailsScrollViewController class]]
+                   ||[curVC isKindOfClass:[videoPlayByAVPlayerViewController class]]){
+                    
                     //切换到竖屏
                     ksharedAppDelegate.supportScreenRotateType = YES;
                     [curVC hx_rotateToInterfaceOrientation:UIInterfaceOrientationPortrait];
@@ -648,16 +656,7 @@
         [self showCalculatorVC];
     }
     
-    
-//    if(isNeeddelayedType){
-//        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-//            ksharedAppDelegate.supportScreenRotateType = NO;
-//            [self showCalculatorVC];
-//        });
-//    }
-//    else{
-//        [self showCalculatorVC];
-//    }
+
 }
 
 - (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {
@@ -783,7 +782,6 @@
     HLog(@"showCalculatorVC 处理密码框弹出")
     
     if(SCREEN_W > SCREEN_H){
-        ksharedAppDelegate.isDelayedShowPwdType = YES;
         HLog(@"showCalculatorVC 屏幕还是横屏状态")
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
             [self showCalculatorVC];
@@ -911,7 +909,6 @@
         [self.window addSubview:_calculatorVC.view];
         ksharedAppDelegate.isDidShowPwdType = YES;
     }
-    ksharedAppDelegate.isDelayedShowPwdType = NO;
     [[NSNotificationCenter defaultCenter] postNotificationName:ShowPwdVCNotification object:nil];
 }
 

+ 3 - 1
创维盒子/双子星云手机/cloudPhone/cloudPhoneViewController.m

@@ -517,6 +517,7 @@
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
         ksharedAppDelegate.isCloudPhoneModeNotPrivacyModeOpenType = NO;
         ksharedAppDelegate.isCloudPhoneModeAndPrivacyModeOpenType = NO;
+        ksharedAppDelegate.needToPushWebRtcVCType = NO;
     });
 }
 
@@ -525,7 +526,8 @@
 {
     KWeakSelf
     mainBlock(^{
-        if(ksharedAppDelegate.isCloudPhoneModeAndPrivacyModeOpenType){
+        if(ksharedAppDelegate.isCloudPhoneModeAndPrivacyModeOpenType
+           || ksharedAppDelegate.needToPushWebRtcVCType){
             [weakSelf queryWebRtcMsgFun:YES];
         }
     });

+ 3 - 5
创维盒子/双子星云手机/webRtc/webRtcPlayerViewController+AppDelegate.m

@@ -24,9 +24,7 @@
 - (void)applicationDidBecomeActive:(NSNotification *)notification
 {
     
-    if(!ksharedAppDelegate.isDidShowPwdType
-       && !ksharedAppDelegate.isDelayedShowPwdType //横屏你让后台 设置竖屏 还是无效 延时显示
-       ){
+    if(!ksharedAppDelegate.isDidShowPwdType){
         //[self resumeStream];
         [self relinkWebRtcFunByBecomeActive];
     }
@@ -55,7 +53,7 @@
 #pragma mark 检测是否为横屏而且 隐私模式 (密码界面只有竖屏 UI会乱)
 - (void)checkLanAndPrivacyModeTypeFun
 {
-    if(!self->isLan){
+    if(!self.isLan){
         return;
     }
     
@@ -63,7 +61,7 @@
         return;
     }
     
-    self->isLan = YES;
+    self.isLan = YES;
     self->isLanAndPrivacyEnterBackground = YES;
     //旋转屏幕为竖屏 (已经在sceneDelegate 处理旋转)
     HLog(@"旋转屏幕为竖屏 (已经在sceneDelegate 处理旋转)")

+ 4 - 1
创维盒子/双子星云手机/webRtc/webRtcPlayerViewController.h

@@ -22,12 +22,12 @@ NS_ASSUME_NONNULL_BEGIN
 {
      CGRect startFrame;//悬浮标拖拽用
     CGFloat lastVideoWHRate;//上传的流宽高比
-    BOOL isLan;//是否是横屏状态
     BOOL isLanAndPrivacyEnterBackground;//是否是横屏状态进入后台
     BOOL didAdjusBtnType;//是否设置过悬浮图标靠边了
     
     ComontAlretViewController *logoutAlertVC;
 }
+@property(nonatomic,assign) BOOL isLan;//是否是横屏状态
 @property (nonatomic, strong) AMediaStream *mediaStream;
 @property(nonatomic,strong)UIButton    *controlBtn;
 @property(nonatomic,strong)webRtcPlayerBottomContrView    *bottomContrView;//底部按钮 选项 home 返回
@@ -37,6 +37,9 @@ NS_ASSUME_NONNULL_BEGIN
 
 #pragma mark 重连
 - (void)relinkWebRtcFunByBecomeActive;
+
+#pragma mark 退出云机
+- (void)exitCloudPhoneFun;
 @end
 
 NS_ASSUME_NONNULL_END

+ 1 - 0
创维盒子/双子星云手机/webRtc/webRtcPlayerViewController.m

@@ -39,6 +39,7 @@
 
 @implementation webRtcPlayerViewController
 @synthesize controlBtn;
+@synthesize isLan;
 
 - (void)viewDidLoad {
     [super viewDidLoad];