Selaa lähdekoodia

1.我的页面监听webrtc链接变化

huangxiaodong 4 päivää sitten
vanhempi
commit
e581f603a4

+ 3 - 0
创维盒子/code/AppDelegate/Config/Notification.h

@@ -160,4 +160,7 @@
 /* 需要退出云手机界面*/
 #define needToPoPCloudPhoneVCNotification                 @"needToPoPCloudPhoneVCNot"
 
+/* 信令通道链接变化*/
+#define webRtcLinkStateChangeNotification                 @"webRtcLinkStateChangeNot"
+
 #endif /* Notification_h */

+ 3 - 0
创维盒子/code/mine/mineViewController.m

@@ -44,6 +44,9 @@
     
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PCLoginDidPopFun)  name:showTabbarNotification  object:nil];
     
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setDataFun)  name:webRtcLinkStateChangeNotification  object:nil];
+    
+    
     [self drawAnyView];
 }
 

+ 4 - 0
创维盒子/code/webRtc/webRtcManager/webRtcManager.m

@@ -1041,6 +1041,8 @@
             break;
         case RTCDataChannelStateOpen:
             {
+                [[NSNotificationCenter defaultCenter] postNotificationName:webRtcLinkStateChangeNotification object:nil];/*发送通知*/
+                
                 //链接成功
                 [self handlAllMsgAfterDidLinkFun];
                 
@@ -1055,6 +1057,8 @@
             break;
         case RTCDataChannelStateClosed:
             {
+                [[NSNotificationCenter defaultCenter] postNotificationName:webRtcLinkStateChangeNotification object:nil];/*发送通知*/
+                
                 //链接断开
                 [self relinkWebRtcFun];
             }