Sfoglia il codice sorgente

1.断开链接弹框优化(上一个日志修复2和5的问题 瑞云断开后无法重连 或者链接时间长)

huangxiaodong 1 anno fa
parent
commit
784c699459

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

@@ -121,6 +121,7 @@ ComontAlretViewControllerDelegate>
     NSTimer *forceStartTimer;//请知重启timer
     
     int preIFrameNum;
+    BOOL isWebSockLinkOKAginType;//WebSock断开后或者链接上了
     
 }
 @property (nonatomic, strong, nullable) RCVideoRecoderManager *recoderManager;
@@ -803,6 +804,7 @@ ComontAlretViewControllerDelegate>
             }
             
         } failure:^(NSError *error) {
+            self->isWebSockLinkOKAginType = NO;
             [self showNetErrorAlertFun:2];
             [self WebSocketNeedRelinkFun];
         }];
@@ -1700,6 +1702,8 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
 #pragma mark 盒子链接成功后需要处理的各种各样事情
 - (void)handlAllMsgAfterDidLinkFun
 {
+    self->isWebSockLinkOKAginType = YES;
+    
     //获取云机尺寸 兼容 720*1080 &1080*1920 不同分辨率的展示和触控
     NSString *getPhoneSizeStr = [RCCommandHelp getPhoneSizecommand];
     [self send_data:getPhoneSizeStr];
@@ -2181,7 +2185,10 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
     
     [cachesFileManager writeLogsWithMsg:[[NSString alloc] initWithFormat:@"showNetErrorAlertFun %ld",type]];
     
-    if(linkFailAlretVC){
+    if(linkFailAlretVC
+       ||[connectDeviceManager shareInstance].isReInitType//瑞云重新init 耗时2-7s 他们说的
+       ||(self->isWebSockLinkOKAginType && type == 2) //重连上了但是延时消息来了
+       ){
         return;
     }
     

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

@@ -32,6 +32,9 @@ typedef void (^netWork_DidEndByOK) (NSInteger didSuc); // 0 fail 1 suc -1 处理
 //是否完成了第一次密码输入
 @property(nonatomic,assign) BOOL  isFirstInputPwdDone;
 
+//重新初始化
+@property(nonatomic,assign) BOOL  isReInitType;
+
 @property(nonatomic,copy) NSString*  tcpPortStr;
 
 #pragma mark 根据扫码的sn获取第三方信息 是否需要重连

+ 2 - 0
创维盒子/双子星云手机/connectDeviceManager/connectDeviceManager.m

@@ -383,7 +383,9 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
         /// 1. 初始化代理库
         [cachesFileManager writeLogsWithMsg:@"tryReconnect initProxy 1"];
         self->disconnected_cb_type = NO;
+        self->_isReInitType = YES;
         [RaylinkProxy.sharedManager initProxy:logUrl.path rootSdnInfo:sdnInfo];
+        self->_isReInitType = NO;
         [cachesFileManager writeLogsWithMsg:@"tryReconnect initProxy 2"];
     });