瀏覽代碼

1.更新音视频SDK 有app控制websocket重连时机

huangxiaodong 1 年之前
父節點
當前提交
5e2b2ab1fc

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

@@ -140,6 +140,8 @@ ComontAlretViewControllerDelegate>
 @property (nonatomic, assign) NSInteger          concentTime; // 拉流数据 渲染更新时间戳
 /**定时器计数*/
 @property (nonatomic, assign) NSInteger          currentTime;
+/**定时器计数*/
+@property (nonatomic, assign) NSInteger          webSocketTime;
 
 /**是否是收入进入云手机*/
 @property (nonatomic, assign) BOOL          isFirstEnterPhone;
@@ -496,6 +498,10 @@ ComontAlretViewControllerDelegate>
         } receive:^(id message, FLSocketCloudPhoneReceiveType type) {
             
             if([message isKindOfClass:[NSData class]] && [message length] == 0){
+                if(type == RCSocketCloudPhoneReceiveTypeForPong)
+                {
+                    [weakSelf keepWebSocketOKFun];
+                }
                 return;
             }
             
@@ -735,6 +741,17 @@ ComontAlretViewControllerDelegate>
     }
 }
 
+- (void)keepWebSocketOKFun
+{
+    self.webSocketTime = 0;
+}
+
+- (void)WebSocketNeedRelinkFun
+{
+    [self showNetErrorAlertFun:2];
+    [self opencommandChannelManagerrc_openURL];
+}
+
 #pragma mark wifi handle
 - (void)sync_wifiBackHandleFun
 {
@@ -2745,6 +2762,7 @@ static int  couneeee = 0;
     self.adjustTime = 3;
     self.concentTime = [iTools getNowTimeStamp];
     self.currentTime = 0;
+    self.webSocketTime = 0;
     
     _timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerChange) userInfo:nil repeats:YES];
     [[NSRunLoop currentRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes];
@@ -2764,6 +2782,15 @@ static int  couneeee = 0;
     
     
     [self checkConcentTime];// 3、30s之后 没有收到拉流数据 自动断开链接
+    
+    //处理websockt是否断开
+    self.webSocketTime++;
+    
+    if(self.webSocketTime == 8)
+    {
+        [self WebSocketNeedRelinkFun];
+    }
+    //HLog(@"webSocketTime %ld",self.webSocketTime);
 }
 
 // 3、30s之后 没有收到拉流数据 自动断开链接

二進制
创维盒子/双子星云手机/CloudPlayer/RCCloudPhoneSDK.framework/RCCloudPhoneSDK


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

@@ -334,6 +334,8 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
     } else {
 //        [self.connectBtn setTitle:@"连接中..." forState:UIControlStateDisabled];
 //        [self.sendBtn setEnabled:NO];
+        
+        HLog(@"瑞云链接断开");
     }
 }