Browse Source

1.拉流页上报打洞状态

huangxiaodong 1 year ago
parent
commit
7ea78be45e

+ 4 - 0
创维盒子/双子星云手机/webRtc/webRtcManager/webRtcManager.h

@@ -81,6 +81,10 @@ NS_ASSUME_NONNULL_BEGIN
 #pragma mark 分类方向
 #pragma mark nas下载完成
 - (void)NasDownloadTaskFinishedNoti:(customDownloadOperation *)nasDownloadOperation;
+
+
+#pragma mark 上报打洞是否成功
+- (void)reportWebRtcRePoportTypeIsChannel:(BOOL)IsChannel withStats:(RTC_OBJC_TYPE(RTCStatisticsReport) *)stats;
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -29,6 +29,7 @@
 @property (nonatomic, copy)   NSTimer      *playerSecondTimer; // 定时器-控制按钮
 @property (nonatomic, assign) RTCIceConnectionState linkState;
 @property (nonatomic, assign) BOOL didHandleRotation;//第一次处理旋转
+@property (nonatomic, assign) BOOL needToReportWebRtcType;//上报打洞是否成功
 @end
 
 @implementation webRtcPlayerViewController
@@ -888,6 +889,12 @@
 }
 
 -(void)didGetStats:(NSString*)peerName stats:(RTC_OBJC_TYPE(RTCStatisticsReport) *)stats {
+    
+    if(!_needToReportWebRtcType){
+        [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:NO withStats:stats];
+        _needToReportWebRtcType = YES;
+    }
+    
     NSString *selectedCandidatePairId = nil;
     NSString *localCandidateId  = nil;
     NSString *remoteCandidateId = nil;