|
@@ -32,7 +32,8 @@
|
|
|
@property (nonatomic, copy) NSTimer *playerSecondTimer; // 定时器-控制按钮
|
|
|
@property (nonatomic, assign) RTCIceConnectionState linkState;
|
|
|
@property (nonatomic, assign) BOOL didHandleRotation;//第一次处理旋转
|
|
|
-@property (nonatomic, assign) BOOL didReportWebRtcType;//上报打洞是否成功
|
|
|
+@property (nonatomic, assign) BOOL didReportWebRtcOKType;//上报打洞是否成功
|
|
|
+@property (nonatomic, assign) BOOL didReportWebRtcFailType;//上报打洞是否成功
|
|
|
|
|
|
@property (nonatomic, strong)playerSetView *playerSetV;//推流设置页
|
|
|
@end
|
|
@@ -50,6 +51,8 @@
|
|
|
[self.navBarBGView setHidden:YES];
|
|
|
[self.view setBackgroundColor:[UIColor blackColor]];
|
|
|
|
|
|
+ _webRtcPlayerSessionId = [iTools getNowTimeStampString];
|
|
|
+
|
|
|
if([DFPlayer sharedPlayer].state == DFPlayerStateBuffering
|
|
|
||[DFPlayer sharedPlayer].state == DFPlayerStatePlaying){
|
|
|
_isCodeSuspendAudioType = YES;
|
|
@@ -387,12 +390,12 @@
|
|
|
if(_linkState != RTCIceConnectionStateConnected
|
|
|
&& _linkState != RTCIceConnectionStateCompleted){
|
|
|
|
|
|
- if(!_didReportWebRtcType){//还没上报过通道链接情况
|
|
|
+ if(!_didReportWebRtcFailType){//还没上报过通道链接情况
|
|
|
tryRelinkNum ++;
|
|
|
if(tryRelinkNum == 2){
|
|
|
tryRelinkNum = 0;
|
|
|
- _didReportWebRtcType = YES;
|
|
|
- [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withStats:nil];
|
|
|
+ _didReportWebRtcFailType = YES;
|
|
|
+ [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:_webRtcPlayerSessionId];
|
|
|
[self showLinkPhoneErrorFun];
|
|
|
}
|
|
|
}
|
|
@@ -1114,8 +1117,9 @@
|
|
|
case RTCIceConnectionStateFailed:
|
|
|
case RTCIceConnectionStateDisconnected:
|
|
|
case RTCIceConnectionStateClosed:{
|
|
|
- if(!_didReportWebRtcType){//还没上报过通道链接情况
|
|
|
- [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withStats:nil];
|
|
|
+ if(!_didReportWebRtcFailType){//还没上报过通道链接情况
|
|
|
+ _didReportWebRtcFailType = YES;
|
|
|
+ [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:_webRtcPlayerSessionId];
|
|
|
|
|
|
//[[addLogObject shareInstance] gotoAddLogFun];
|
|
|
}
|
|
@@ -1176,9 +1180,10 @@
|
|
|
|
|
|
-(void)didGetStats:(NSString*)peerName stats:(RTC_OBJC_TYPE(RTCStatisticsReport) *)stats {
|
|
|
|
|
|
- if(!_didReportWebRtcType){
|
|
|
- [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:NO withStats:stats];
|
|
|
- _didReportWebRtcType = YES;
|
|
|
+ if(!_didReportWebRtcOKType){
|
|
|
+ [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:NO withStats:stats withSessionId:_webRtcPlayerSessionId];
|
|
|
+ _didReportWebRtcOKType = YES;
|
|
|
+ _didReportWebRtcFailType = NO;//链接成功后 失败要重新上报
|
|
|
}
|
|
|
|
|
|
NSString *selectedCandidatePairId = nil;
|
|
@@ -1406,6 +1411,16 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+- (void)connectionChange:(NSString*)peerName
|
|
|
+ didChangeLocalCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)local
|
|
|
+ remoteCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)remote
|
|
|
+ lastReceivedMs:(int)lastDataReceivedMs
|
|
|
+ changeReason:(NSString *)reason
|
|
|
+{
|
|
|
+ //HLog(@"webRtc P2P didChangeLocalCandidate")
|
|
|
+ [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withLocal:local remoteCandidate:remote withSessionId:self.webRtcPlayerSessionId];
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark 更新悬浮图标的颜色
|
|
|
- (void)updateControlBtnBgImageWith:(NSInteger)delayedMS{
|
|
|
if (delayedMS < 50) {
|