浏览代码

1.推流界面重连

huangxiaodong 1 年之前
父节点
当前提交
e76aa42b04
共有 1 个文件被更改,包括 19 次插入29 次删除
  1. 19 29
      创维盒子/双子星云手机/webRtc/webRtcPlayerViewController.m

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

@@ -172,12 +172,12 @@
 #pragma mark 重连
 - (void)relinkWebRtcFun
 {
-    if(_linkState == RTCIceConnectionStateConnected
-       || _linkState == RTCIceConnectionStateCompleted)
-    {//链接中 不处理重连事件
-        HLog(@"链接中 不处理重连事件")
-        return;
-    }
+//    if(_linkState == RTCIceConnectionStateConnected
+//       || _linkState == RTCIceConnectionStateCompleted)
+//    {//链接中 不处理重连事件
+//        HLog(@"链接中 不处理重连事件")
+//        return;
+//    }
     
     HLog(@"发起重连 ......")
     
@@ -186,15 +186,13 @@
         [weakSelf showNewIndicatorWithCanBack:YES canTouch:NO];
         
         //判断是否是全屏
-//        BOOL fullscreenType = [HWDataManager getBoolWithKey:Consn_player_full_screen_show];
-//        CGSize  phoneSize = CGSizeMake(1080.0, 1920.0);
-//        if(fullscreenType){
-//            phoneSize = [RCCommandHelp commondToSetFullScreenPhoneSizeBySize];
-//        }
-//        
-//        [weakSelf linkWebRtcFunWithSize:phoneSize];
+        BOOL fullscreenType = [HWDataManager getBoolWithKey:Consn_player_full_screen_show];
+        CGSize  phoneSize = CGSizeMake(1080.0, 1920.0);
+        if(fullscreenType){
+            phoneSize = [RCCommandHelp commondToSetFullScreenPhoneSizeBySize];
+        }
         
-        [weakSelf beginWebRtcPlayFun];
+        [weakSelf linkWebRtcFunWithSize:phoneSize];
     });
 }
 
@@ -386,7 +384,7 @@
     
     [self startForceStartTimerFun];
     
-    [self pauseStream];
+    //[self pauseStream];
     
     [webRtcManager shareManager].isRebootIngType = YES;
     
@@ -825,18 +823,10 @@
             //链接完成
             break;
         case RTCIceConnectionStateFailed:
-            //链接失败
-            [self relinkWebRtcFun];
-            break;
         case RTCIceConnectionStateDisconnected:
-            //链接断开
-            [self relinkWebRtcFun];
-            break;
         case RTCIceConnectionStateClosed:
             //链接关闭
-            if([webRtcManager shareManager].isRebootIngType){
-                [self relinkWebRtcFun];
-            }
+            [self relinkWebRtcFun];
             break;
             
         default:
@@ -936,7 +926,7 @@
                 
                 preReceive = (diffReceive / diffTime) * 1000000;
                 
-                HLog(@"传输数据速度---->%ld",preReceive);
+                //HLog(@"传输数据速度---->%ld",preReceive);
                 
 //                mainBlock((^{
 //                    if (self->mPlayerView.upControlView.hidden == NO){
@@ -1002,8 +992,8 @@
                     localCandidateId  = [rtcStatistics.values objectForKey:@"localCandidateId"];
                     remoteCandidateId = [rtcStatistics.values objectForKey:@"remoteCandidateId"];
 
-                    HLog(@"三网数据--localCandidateId-->%@",localCandidateId);
-                    HLog(@"三网数据--remoteCandidateId-->%@",remoteCandidateId);
+//                    HLog(@"三网数据--localCandidateId-->%@",localCandidateId);
+//                    HLog(@"三网数据--remoteCandidateId-->%@",remoteCandidateId);
                 }
             }
         }
@@ -1017,7 +1007,7 @@
             if ([rtcStatistics.type isEqualToString:@"local-candidate"]){
                 NSString *templocalCandidateId = rtcStatistics.id;
                 if ([templocalCandidateId isEqualToString:localCandidateId]) {
-                    HLog(@"三网数据--localCandidateIdInfo-->%@",rtcStatistics.values);
+                    //HLog(@"三网数据--localCandidateIdInfo-->%@",rtcStatistics.values);
                     localCandidateStr = @"本地\n";
                     NSString *candidateType = [rtcStatistics.values objectForKey:@"candidateType"];
                     if (candidateType) {
@@ -1043,7 +1033,7 @@
             }else if ([rtcStatistics.type isEqualToString:@"remote-candidate"]){
                 NSString *tempRemoteCandidateId = rtcStatistics.id;
                 if ([tempRemoteCandidateId isEqualToString:remoteCandidateId]) {
-                    HLog(@"三网数据--remoteCandidateIdInfo-->%@",rtcStatistics.values);
+                    //HLog(@"三网数据--remoteCandidateIdInfo-->%@",rtcStatistics.values);
                     remoteCandidateStr = @"远端\n";
                     NSString *candidateType = [rtcStatistics.values objectForKey:@"candidateType"];
                     if (candidateType) {