|
|
@@ -27,11 +27,12 @@
|
|
|
|
|
|
NSInteger checkLinkTimerNumber;//0 --2 开始发起重连
|
|
|
NSInteger preDelayedMS;//记录上一次延时数据 控制controlBtn 的图片刷新 非必要 不刷新
|
|
|
+ NSInteger tryRelinkNum;//重连次数
|
|
|
}
|
|
|
@property (nonatomic, copy) NSTimer *playerSecondTimer; // 定时器-控制按钮
|
|
|
@property (nonatomic, assign) RTCIceConnectionState linkState;
|
|
|
@property (nonatomic, assign) BOOL didHandleRotation;//第一次处理旋转
|
|
|
-@property (nonatomic, assign) BOOL needToReportWebRtcType;//上报打洞是否成功
|
|
|
+@property (nonatomic, assign) BOOL didReportWebRtcType;//上报打洞是否成功
|
|
|
|
|
|
@property (nonatomic, strong)playerSetView *playerSetV;//推流设置页
|
|
|
@end
|
|
|
@@ -330,6 +331,15 @@
|
|
|
|
|
|
if(_linkState != RTCIceConnectionStateConnected
|
|
|
&& _linkState != RTCIceConnectionStateCompleted){
|
|
|
+
|
|
|
+ if(!_didReportWebRtcType){//还没上报过通道链接情况
|
|
|
+ tryRelinkNum ++;
|
|
|
+ if(tryRelinkNum == 6){
|
|
|
+ _didReportWebRtcType = YES;
|
|
|
+ [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withStats:nil];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
[self relinkWebRtcFun];
|
|
|
}
|
|
|
}
|
|
|
@@ -948,9 +958,13 @@
|
|
|
break;
|
|
|
case RTCIceConnectionStateFailed:
|
|
|
case RTCIceConnectionStateDisconnected:
|
|
|
- case RTCIceConnectionStateClosed:
|
|
|
+ case RTCIceConnectionStateClosed:{
|
|
|
+ if(!_didReportWebRtcType){//还没上报过通道链接情况
|
|
|
+ [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withStats:nil];
|
|
|
+ }
|
|
|
//链接关闭
|
|
|
[self relinkWebRtcFun];
|
|
|
+ }
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
@@ -1004,9 +1018,9 @@
|
|
|
|
|
|
-(void)didGetStats:(NSString*)peerName stats:(RTC_OBJC_TYPE(RTCStatisticsReport) *)stats {
|
|
|
|
|
|
- if(!_needToReportWebRtcType){
|
|
|
+ if(!_didReportWebRtcType){
|
|
|
[[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:NO withStats:stats];
|
|
|
- _needToReportWebRtcType = YES;
|
|
|
+ _didReportWebRtcType = YES;
|
|
|
}
|
|
|
|
|
|
NSString *selectedCandidatePairId = nil;
|