瀏覽代碼

1.webrtc通道重连优化

huangxiaodong 1 年之前
父節點
當前提交
2bddd03bd9

+ 2 - 2
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -6111,7 +6111,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 4;
+				CURRENT_PROJECT_VERSION = 5;
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -6193,7 +6193,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 4;
+				CURRENT_PROJECT_VERSION = 5;
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (

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

@@ -35,6 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property(nonatomic,assign)BOOL isDiDChangePhoneSizeType;//是否修改了分辨率(如果是 进去云机需要重设解码器)
 
 @property(nonatomic,assign) RTCDataChannelState  channelState;
+@property(nonatomic,assign) RTCIceConnectionState ConnectionState;
 
 #pragma mark 分类属性
 #pragma mark 下载nas文件用到

+ 5 - 1
创维盒子/双子星云手机/webRtc/webRtcManager/webRtcManager.m

@@ -53,7 +53,10 @@
 #pragma mark 检测链接是否OK
 - (void)checkChannelLinkStateFun
 {
-    if(_channelState != RTCDataChannelStateOpen){
+    if(_channelState != RTCDataChannelStateOpen
+       ||(_ConnectionState != RTCIceConnectionStateConnected
+          && _ConnectionState != RTCIceConnectionStateCompleted)
+       ){
         [self relinkWebRtcFun];
     }
 }
@@ -828,6 +831,7 @@
 -(void)onChangeConnectionStateFromPeerName:(NSString*)peerName didChangeIceConnectionState:(RTCIceConnectionState)state
 {
     HLog(@"channel P2P onChangeConnectionStateFromPeerName: state:%ld",state)
+    self.ConnectionState = state;
     switch (state) {
         case RTCIceConnectionStateConnected:{
             //链接成功