Forráskód Böngészése

1.同一盒子,手机设备1开启全面屏退到后台,另一手机设备2开启TV投屏,返回手机设备1查看仍是全面屏状态

huangxiaodong 10 hónapja%!(EXTRA string=óta)
szülő
commit
b949ea3b90

+ 3 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+AppDelegate.h

@@ -18,6 +18,9 @@ NS_ASSUME_NONNULL_BEGIN
 @property NSString *nowSSid;
 
 - (void)updateCopydata;
+
+#pragma mark 全面屏与TV投屏逻辑交互
+- (void)checkFullScreenWithTVShowStateFun;
 @end
 
 NS_ASSUME_NONNULL_END

+ 35 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+AppDelegate.m

@@ -103,6 +103,10 @@
     
     [self setShowImgAndVoiceTypeFun:YES];
     [self updateCopydata];
+    
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [self checkFullScreenWithTVShowStateFun];
+    });
 }
 
 - (void)applicationWillTerminate:(UIApplication *)application {
@@ -154,4 +158,35 @@
     }
     
 }
+
+#pragma mark 全面屏与TV投屏逻辑交互
+- (void)checkFullScreenWithTVShowStateFun
+{
+    BOOL isTVShowType = ksharedAppDelegate.TvStatusMod.isTVShowType;
+    BOOL fullscreenType = [HWDataManager getBoolWithKey:Consn_player_full_screen_show];
+    
+    if(isTVShowType && fullscreenType){//关闭全屏屏
+        [HWDataManager setBoolWithKey:Consn_player_full_screen_show value:NO];
+        fullscreenType = NO;
+        //通知界面修改UI
+        [[NSNotificationCenter defaultCenter] postNotificationName:setPlayerFullScreenNotification object:nil];
+    }
+    
+    //重新设置分辨率
+    if(fullscreenType){
+        NSString *commandStr = [RCCommandHelp commondToSetFullScreenPhoneSize];
+        [[webSocketManager shareInstance] send_data:commandStr];
+    }
+    else{
+        if ((ksharedAppDelegate.couldPhone_W_PHONE == 720 && ksharedAppDelegate.couldPhone_H_PHONE == 1280)
+            || (ksharedAppDelegate.couldPhone_W_PHONE == 1080 && ksharedAppDelegate.couldPhone_H_PHONE == 1920)) {//云机可能存在的分辨率
+            
+        }
+        else{
+            NSString *commondStr  = @"{\"data\":{\"height\":1920,\"width\":1080},\"type\":\"setPhoneSize\"}";
+            [[webSocketManager shareInstance] send_data:commondStr];
+        }
+    }
+}
+
 @end

+ 12 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController.mm

@@ -203,6 +203,9 @@ UIDocumentPickerDelegate>
         _isCodeSuspendAudioType = YES;
         [[DFPlayer sharedPlayer] df_pause];
     }
+    
+    
+    [self checkFullScreenWithTVShowStateFun];
 }
 
 #pragma mark 启动检测瑞云的timer
@@ -1388,6 +1391,10 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
 -(void)setShowPwdVCTypeFun
 {
     _isPwdVCShow = YES;
+    
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [self checkFullScreenWithTVShowStateFun];
+    });
 }
 
 -(void)setShowImgAndVoiceTypeFun
@@ -2363,6 +2370,11 @@ static int  couneeee = 0;
     if(fullscreenType){
         NSString *commandStr = [RCCommandHelp commondToSetFullScreenPhoneSize];
         [self send_data:commandStr];
+        
+        KWeakSelf
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [weakSelf reSetResolutionFactorFun];
+        });
     }
     else{
         NSString *commondStr  = @"{\"data\":{\"height\":1920,\"width\":1080},\"type\":\"setPhoneSize\"}";

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

@@ -204,27 +204,7 @@
             break;
         case 2:
         {
-            BOOL isTVShowType = ksharedAppDelegate.TvStatusMod.isTVShowType;
-            if(isTVShowType){//关闭全屏屏
-                [HWDataManager setBoolWithKey:Consn_player_full_screen_show value:NO];
-            }
-            
-            BOOL fullscreenType = [HWDataManager getBoolWithKey:Consn_player_full_screen_show];
-            //重新设置分辨率
-            if(fullscreenType){
-                NSString *commandStr = [RCCommandHelp commondToSetFullScreenPhoneSize];
-                [[webSocketManager shareInstance] send_data:commandStr];
-            }
-            else{
-                if ((ksharedAppDelegate.couldPhone_W_PHONE == 720 && ksharedAppDelegate.couldPhone_H_PHONE == 1280)
-                    || (ksharedAppDelegate.couldPhone_W_PHONE == 1080 && ksharedAppDelegate.couldPhone_H_PHONE == 1920)) {//云机可能存在的分辨率
-                    
-                }
-                else{
-                    NSString *commondStr  = @"{\"data\":{\"height\":1920,\"width\":1080},\"type\":\"setPhoneSize\"}";
-                    [[webSocketManager shareInstance] send_data:commondStr];
-                }
-            }
+            //[self checkFullScreenWithTVShowStateFun];
             
             PlayerViewController *vc = [PlayerViewController new];
             [self pushViewController:vc animated:YES];

+ 1 - 0
创维盒子/双子星云手机/cloudPhone/websocket/webSocketManager.h

@@ -71,6 +71,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property(nonatomic,assign)BOOL isResetingType;//是否恢复出厂中
 @property(nonatomic,assign)BOOL isChangeBoxType;//是否更换盒子
 @property(nonatomic,assign)BOOL isLogoutByOtherType;//被挤下线
+@property(nonatomic,assign)BOOL isWaitShowLogoutAlert;//隐私模式等待被挤下线弹框是否弹出
 
 @property(nonatomic,assign)BOOL isDiDChangePhoneSizeType;//是否修改了分辨率(如果是 进去云机需要重设解码器)
 

+ 15 - 0
创维盒子/双子星云手机/cloudPhone/websocket/webSocketManager.m

@@ -955,6 +955,7 @@ static webSocketManager *webSocketManagerInstance = nil;
         return;
     }
     
+    
     //通知音视频断开链接
     [[NSNotificationCenter defaultCenter] postNotificationName:logoutByOtherNotification object:nil];
     
@@ -976,11 +977,24 @@ static webSocketManager *webSocketManagerInstance = nil;
     
     _isLogoutByOtherType = YES;
     _didSendfristMsg = NO;
+    _isWaitShowLogoutAlert = YES;
     
     //被挤下线 ws断开
     [self.commandChannelManager rc_close];
     self.commandChannelManager = nil;
     
+    if(ksharedAppDelegate.isDidShowPwdType){
+        
+        KWeakSelf
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [weakSelf LogoutByOtherFun];
+            HLog(@"weakSelf LogoutByOtherFun")
+        });
+        return;
+    }
+    
+    _isWaitShowLogoutAlert = NO;;
+    
     /*弹窗提示重启*/
     //KWeakSelf
     logoutAlertVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"single_sign_on_Tips_logout",nil)
@@ -993,6 +1007,7 @@ static webSocketManager *webSocketManagerInstance = nil;
         //[[webSocketManager shareInstance] WebSocketNeedRelinkFun];
         
         self->_isLogoutByOtherType = NO;
+        self->logoutAlertVC = nil;
         [[NSNotificationCenter defaultCenter] postNotificationName:lockBypwdNotification object:nil];
         
     } didClickCancel:^{