Kaynağa Gözat

1.退出登录 重新登录 后台相关处理

huangxiaodong 1 yıl önce
ebeveyn
işleme
091fcdd1d3

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

@@ -813,6 +813,10 @@
 		6B9773A22C637E3A00213317 /* nasUploadFileManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B97739F2C637E3A00213317 /* nasUploadFileManager.h */; };
 		6B9773A32C637E3A00213317 /* nasUploadFileManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B97739F2C637E3A00213317 /* nasUploadFileManager.h */; };
 		6B9773A42C637E3A00213317 /* nasUploadFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B9773A02C637E3A00213317 /* nasUploadFileManager.m */; };
+		6BA00E2D2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BA00E2C2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.m */; };
+		6BA00E2E2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BA00E2B2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.h */; };
+		6BA00E2F2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BA00E2C2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.m */; };
+		6BA00E302C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BA00E2B2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.h */; };
 		6BA08F082C0187DD00A2242D /* boxDownloadFileRecordCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BA08F062C0187DC00A2242D /* boxDownloadFileRecordCell.h */; };
 		6BA08F092C0187DD00A2242D /* boxDownloadFileRecordCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BA08F072C0187DC00A2242D /* boxDownloadFileRecordCell.m */; };
 		6BA08F0A2C0187DD00A2242D /* boxDownloadFileRecordCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BA08F062C0187DC00A2242D /* boxDownloadFileRecordCell.h */; };
@@ -2034,6 +2038,8 @@
 		6B97739A2C637C4800213317 /* nasUploadManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = nasUploadManager.m; sourceTree = "<group>"; };
 		6B97739F2C637E3A00213317 /* nasUploadFileManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = nasUploadFileManager.h; sourceTree = "<group>"; };
 		6B9773A02C637E3A00213317 /* nasUploadFileManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = nasUploadFileManager.m; sourceTree = "<group>"; };
+		6BA00E2B2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "webRtcPlayerViewController+AppDelegate.h"; sourceTree = "<group>"; };
+		6BA00E2C2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "webRtcPlayerViewController+AppDelegate.m"; sourceTree = "<group>"; };
 		6BA08F062C0187DC00A2242D /* boxDownloadFileRecordCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = boxDownloadFileRecordCell.h; sourceTree = "<group>"; };
 		6BA08F072C0187DC00A2242D /* boxDownloadFileRecordCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = boxDownloadFileRecordCell.m; sourceTree = "<group>"; };
 		6BA08F3B2C01D05B00A2242D /* CWFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CWFileManager.h; sourceTree = "<group>"; };
@@ -3437,6 +3443,8 @@
 				6B3E7A6D2C89478A00B032C4 /* webRtcPlayerViewController+AdjustBtnFrame.m */,
 				6B3E7A792C89AD5500B032C4 /* webRtcPlayerViewController+AdjustPlayerViewFrame.h */,
 				6B3E7A7A2C89AD5500B032C4 /* webRtcPlayerViewController+AdjustPlayerViewFrame.m */,
+				6BA00E2B2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.h */,
+				6BA00E2C2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.m */,
 			);
 			path = webRtc;
 			sourceTree = "<group>";
@@ -4214,6 +4222,7 @@
 				187076772A9F400300F15F7F /* PlayerLoadingView.h in Headers */,
 				6B7EA7982BF5B4A6002D5CC2 /* NASFilePicModel.h in Headers */,
 				6B7E04342C3E5A98004B4948 /* NSURLSession+customDownloadTask.h in Headers */,
+				6BA00E2E2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.h in Headers */,
 				6B2C1E902C070ADE00FDCF82 /* ZFPlayerLogManager.h in Headers */,
 				6B1CC2CE2B6B6D6B00AD4217 /* commandSendCheckModel.h in Headers */,
 				6B0581602AFCD0DF00D37290 /* uploadImageOrVideoViewController.h in Headers */,
@@ -4501,6 +4510,7 @@
 				6BD506F42B9576A4006E7CB0 /* PlayerLoadingView.h in Headers */,
 				6B7EA79A2BF5B4A6002D5CC2 /* NASFilePicModel.h in Headers */,
 				6B7E04352C3E5A98004B4948 /* NSURLSession+customDownloadTask.h in Headers */,
+				6BA00E302C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.h in Headers */,
 				6B2C1E912C070ADE00FDCF82 /* ZFPlayerLogManager.h in Headers */,
 				6BD506F52B9576A4006E7CB0 /* commandSendCheckModel.h in Headers */,
 				6BD506F62B9576A4006E7CB0 /* uploadImageOrVideoViewController.h in Headers */,
@@ -5204,6 +5214,7 @@
 				6BD5079B2B9576A4006E7CB0 /* FMDatabaseAdditions.m in Sources */,
 				6BD5079C2B9576A4006E7CB0 /* BGDB.m in Sources */,
 				6BD5079D2B9576A4006E7CB0 /* UITextfield+NLLimit.m in Sources */,
+				6BA00E2F2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.m in Sources */,
 				6BD5079E2B9576A4006E7CB0 /* backupsFileRecordCell.m in Sources */,
 				6BD5079F2B9576A4006E7CB0 /* downLoadPreviewViewController.m in Sources */,
 				6B2C1E672C070ADE00FDCF82 /* ZFLandscapeRotationManager_iOS15.m in Sources */,
@@ -5573,6 +5584,7 @@
 				A08A950127E9A4E400C544BB /* FMDatabaseAdditions.m in Sources */,
 				A08A94FB27E9A4E400C544BB /* BGDB.m in Sources */,
 				A003F6B427D841EE00715CBF /* UITextfield+NLLimit.m in Sources */,
+				6BA00E2D2C9AA826003AE520 /* webRtcPlayerViewController+AppDelegate.m in Sources */,
 				6B1FBD3F2B46875300926382 /* backupsFileRecordCell.m in Sources */,
 				6B5D40242B4AA7BF000965CF /* downLoadPreviewViewController.m in Sources */,
 				6B2C1E662C070ADE00FDCF82 /* ZFLandscapeRotationManager_iOS15.m in Sources */,

BIN
创维盒子/双子星云手机/webRtc/WebRTC.framework/WebRTC


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

@@ -102,6 +102,7 @@
 - (void)send_data:(NSString *)dataStr
 {
     [_mediaStream sendData:dataStr];
+    HLog(@"客户端发出命令:%@",dataStr);
 }
 
 
@@ -152,15 +153,15 @@
     {
         [self getSysInfoFun];
         
-        NSString *curOaidStr = [RcGameWQKeyChain getOaidStringFun];
-        if(!curOaidStr){
-            curOaidStr = @"";
-        }
+//        NSString *curOaidStr = [RcGameWQKeyChain getOaidStringFun];
+//        if(!curOaidStr){
+//            curOaidStr = @"";
+//        }
         
-        //未调通挤下线
-        NSString *commondStr = [[NSString alloc] initWithFormat:@"{\"type\":\"login\",\"value\":\"%@\"}",curOaidStr];
-        [self send_data:commondStr];
-        [self addCommandSendTaskFunWithType:@"offline_notification" WithCommandStr:commondStr];
+//        //未调通挤下线
+//        NSString *commondStr = [[NSString alloc] initWithFormat:@"{\"type\":\"login\",\"value\":\"%@\"}",curOaidStr];
+//        [self send_data:commondStr];
+//        [self addCommandSendTaskFunWithType:@"offline_notification" WithCommandStr:commondStr];
         
         _didSendfristMsg = YES;
         
@@ -601,6 +602,10 @@
         return;
     }
     
+    if(![[dataDict allKeys] containsObject:@"type"]){
+        return;
+    }
+    
     NSString *messageType = dataDict[@"type"];
     
     if ([messageType isEqualToString:@"cutting"]) {
@@ -805,7 +810,7 @@
 #pragma mark 不能再这里函数判断  这个是推拉流的
 -(void)onChangeConnectionStateFromPeerName:(NSString*)peerName didChangeIceConnectionState:(RTCIceConnectionState)state
 {
-    HLog(@"channel onChangeConnectionStateFromPeerName: state:%ld",state)
+    HLog(@"channel P2P onChangeConnectionStateFromPeerName: state:%ld",state)
 //    switch (state) {
 //        case RTCIceConnectionStateConnected:{
 //            //链接成功
@@ -835,6 +840,7 @@
 #pragma mark 通道连接状态变化监听
 - (void)dataChannelDidChangeFromPeerName:(NSString*)peerName State:(RTCDataChannelState)state
 {
+    HLog(@"webRtc P2P dataChannelDidChangeFromPeerName: state:%ld",state)
     self.channelState = state;
     switch (state) {
         case RTCDataChannelStateConnecting:
@@ -875,9 +881,6 @@
     }
 }
 
--(void)onIceConnectedFromPeerName:(NSString*)peerName{
-    HLog(@"onIceConnectedFromPeerName:%@",peerName);
-}
 
 -(void)didGetStats:(NSString*)peerName stats:(RTC_OBJC_TYPE(RTCStatisticsReport) *)stats
 {
@@ -890,6 +893,6 @@
 }
 -(void)onAuthResultFromPeerName:(NSString*)peerName code:(int)code descriptions:(NSString*)descriptions
 {
-    HLog(@"onAuthResultFromPeerName")
+    HLog(@"webRtc P2P onAuthResultFromPeerName")
 }
 @end

+ 24 - 0
创维盒子/双子星云手机/webRtc/webRtcPlayerViewController+AppDelegate.h

@@ -0,0 +1,24 @@
+//
+//  webRtcPlayerViewController+AppDelegate.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/9/18.
+//
+
+#import "webRtcPlayerViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface webRtcPlayerViewController (AppDelegate)
+
+#pragma mark 云机停止拉流
+- (void)pauseStream;
+
+#pragma mark 云机唤醒拉流
+- (void)resumeStream;
+
+#pragma mark 输入密码完成
+- (void)didInpuPwdOkFun;
+@end
+
+NS_ASSUME_NONNULL_END

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

@@ -0,0 +1,55 @@
+//
+//  webRtcPlayerViewController+AppDelegate.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/9/18.
+//
+
+#import "webRtcPlayerViewController+AppDelegate.h"
+
+@implementation webRtcPlayerViewController (AppDelegate)
+
+#pragma mark - UIApplication Delegate
+- (void)applicationWillResignActive:(NSNotification *)notification
+{
+    //HLog(@"11111");
+}
+
+- (void)applicationDidEnterBackground:(NSNotification *)notification {
+    //  app进入后台时
+    [self pauseStream];
+}
+
+- (void)applicationDidBecomeActive:(NSNotification *)notification
+{
+    if(!ksharedAppDelegate.isDidShowPwdType){
+        [self resumeStream];
+    }
+
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application {
+    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+    
+    [self.mediaStream disconnect];
+}
+
+#pragma mark 云机停止拉流
+- (void)pauseStream
+{
+    [self.mediaStream pauseStream];
+}
+
+#pragma mark 云机唤醒拉流
+- (void)resumeStream
+{
+    [self.mediaStream resumeStream];
+}
+
+
+#pragma mark 输入密码完成
+- (void)didInpuPwdOkFun
+{
+    [self resumeStream];
+}
+@end

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

@@ -11,6 +11,8 @@
 #import "UIView+HWCategory.h"
 #import "webRtcMsgModel.h"
 #import "webRtcPlayerBottomContrView.h"
+#import "RcGameWQKeyChain.h"
+#import "ComontAlretViewController.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -20,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
     CGFloat lastVideoWHRate;//上传的流宽高比
     BOOL isLan;//是否是横屏状态
     BOOL didAdjusBtnType;//是否设置过悬浮图标靠边了
+    
+    ComontAlretViewController *logoutAlertVC;
 }
 @property (nonatomic, strong) AMediaStream *mediaStream;
 @property(nonatomic,strong)UIButton    *controlBtn;

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

@@ -8,7 +8,7 @@
 #import "webRtcPlayerViewController.h"
 #import "webRtcPlayerViewController+AdjustBtnFrame.h"
 #import "webRtcPlayerViewController+AdjustPlayerViewFrame.h"
-
+#import "webRtcPlayerViewController+AppDelegate.h"
 
 #import "UIInterface+HXRotation.h"
 #import "playerSetView.h"
@@ -341,8 +341,7 @@
     
     [self startForceStartTimerFun];
     
-    //最后一帧 没显示正在重启问题
-    //_canShowImgAndVoiceType = YES;
+    [self pauseStream];
     
     [webRtcManager shareManager].isRebootIngType = YES;
 }
@@ -468,6 +467,88 @@
     [[webRtcManager shareManager] offTvFun];
 }
 
+#pragma mark 挤下线功能
+-(void)offlineOtherPhoneFun
+{
+    NSString *curOaidStr = [RcGameWQKeyChain getOaidStringFun];
+    if(!curOaidStr){
+        curOaidStr = @"";
+    }
+    NSString *commondStr = [[NSString alloc] initWithFormat:@"{\"type\":\"login\",\"value\":\"%@\"}",curOaidStr];
+    [self send_dataInPlayer:commondStr];
+}
+
+#pragma mark 单点登录被挤下线弹框
+- (void)LogoutByOtherFun:(NSString*)oaid
+{
+    
+    if(logoutAlertVC){
+        return;
+    }
+    
+    NSString *curOaidStr = [RcGameWQKeyChain getOaidStringFun];
+    
+    if(oaid
+       && oaid.length >0
+       && [oaid isEqualToString:curOaidStr]){
+        return;
+    }
+    
+    //[self didReceiveLogoutMsgFun];
+    
+    
+    //yyyy-MM-dd HH:mm:ss
+    NSString*dateStr = [iTools getNowTimeString2];
+    if(dateStr && dateStr.length == 19){
+        dateStr = [dateStr substringWithRange:NSMakeRange(11, 5)];
+    }
+    
+    NSString *LogoutTimerStr = [[NSString alloc] initWithFormat:@"%@%@%@",NSLocalizedString(@"single_sign_on_Tips_one",nil),dateStr,NSLocalizedString(@"single_sign_on_Tips_two",nil)];
+    
+    
+    NSString * loginAgainStr = NSLocalizedString(@"single_sign_on_login_again",nil);
+    BOOL isOkBtnHighlight = YES;
+    if(!ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode){
+        loginAgainStr = @"";
+        isOkBtnHighlight = NO;
+    }
+    
+
+    KWeakSelf
+
+    if(ksharedAppDelegate.isDidShowPwdType){
+        
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [weakSelf LogoutByOtherFun:oaid];
+            HLog(@"weakSelf LogoutByOtherFun")
+        });
+        return;
+    }
+    
+    //被挤下线 停止拉流
+    [self pauseStream];
+    
+    /*弹窗提示重启*/
+    //KWeakSelf
+    logoutAlertVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"single_sign_on_Tips_logout",nil)
+                                                                                     msg:LogoutTimerStr
+                                                                                imageStr:@""
+                                                                             cancelTitle:NSLocalizedString(@"single_sign_on_exit",nil)
+                                                                                 okTitle:loginAgainStr isOkBtnHighlight:isOkBtnHighlight
+                                                                             didClickOk:^{
+        self->logoutAlertVC = nil;
+        [[NSNotificationCenter defaultCenter] postNotificationName:lockBypwdNotification object:nil];
+        
+    } didClickCancel:^{
+        exit(0);/*强制退出app*/
+    }];
+    logoutAlertVC.modalPresentationStyle = UIModalPresentationCustom;
+
+    [[iTools appRootViewController] presentViewController:logoutAlertVC animated:YES completion:^{
+        self->logoutAlertVC.view.superview.backgroundColor = [UIColor clearColor];
+    }];
+    
+}
 #pragma mark 底部按钮事件
 - (void)didClickBottomFunBy:(NSInteger)tag
 {
@@ -494,12 +575,18 @@
     [_mediaStream sendKey:keyType];
 }
 
-#pragma mark 云机交互的消息发送
+#pragma mark 云机交互的消息发送 走P2P通道
 -(void)send_data:(NSString*)commandStr
 {
     [[webRtcManager shareManager] send_data:commandStr];
 }
 
+#pragma mark 云机交互的消息发送 走音视频推拉流通道
+-(void)send_dataInPlayer:(NSString*)commandStr
+{
+    [_mediaStream sendData:commandStr];
+}
+
 #pragma mark -- /*底部导航栏开关通知*/
 - (void)getPlayerBottomNavShowOrHidefun
 {
@@ -581,6 +668,15 @@
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getPlayerBottomNavShowOrHidefun)  name:getPlayerBottomNavNotification  object:nil];
     
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setPlayerFullScreenNotFun)  name:setPlayerFullScreenNotification  object:nil];
+    
+    //监听系统 前后台事件
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:)    name:UIApplicationWillTerminateNotification    object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:)  name:UIApplicationDidBecomeActiveNotification  object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillResignActive:) name:UIApplicationWillResignActiveNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil];
+    
+    //输入密码完成
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didInpuPwdOkFun) name:didInputPWDNotification object:nil];
 }
 
 - (void)removeKVOObserverFun
@@ -651,7 +747,7 @@
 #pragma mark WebRTC 回调 MediaStreamClientEventsDelegate
 #pragma mark - 宽高变化
 -(void)onFrameResolutionChangedFromPeerName:(NSString*)peerName videoWidth:(int)videoWidth videoHeight:(int)videoHeight rotation:(int)rotation {
-    HLog(@"onFrameResolutionChangedFromPeerName:%@---%d---%d--%d",peerName,videoWidth,videoHeight,rotation)
+    HLog(@"推拉流 onFrameResolutionChangedFromPeerName:%@---%d---%d--%d",peerName,videoWidth,videoHeight,rotation)
     
     mainBlock(^{
         [self handlUIAfterGetCloudPhoneVideoWidth:videoWidth videoHeight:videoHeight rotation:rotation];
@@ -667,7 +763,7 @@
 #pragma mark 链接发生变化
 -(void)onChangeConnectionStateFromPeerName:(NSString*)peerName didChangeIceConnectionState:(RTCIceConnectionState)state
 {
-    HLog(@"onChangeConnectionStateFromPeerName: state:%ld",state)
+    HLog(@"推拉流 onChangeConnectionStateFromPeerName: state:%ld",state)
     _linkState = state;
     switch (state) {
         case RTCIceConnectionStateConnected:{
@@ -702,19 +798,87 @@
     
 }
 
-- (void)dataChannelDidChangeFromPeerName:(NSString*)peerName State:(RTCDataChannelState)state{
-    ;
+- (void)dataChannelDidChangeFromPeerName:(NSString*)peerName State:(RTCDataChannelState)state;
+{
+    HLog(@"推拉流 dataChannelDidChangeFromPeerName: state:%ld",state)
+    switch (state) {
+        case RTCDataChannelStateConnecting:
+            {
+                
+            }
+            break;
+        case RTCDataChannelStateOpen:
+            {
+                //链接成功
+                [self offlineOtherPhoneFun];
+            }
+            break;
+        case RTCDataChannelStateClosing:
+            {
+                
+            }
+            break;
+        case RTCDataChannelStateClosed:
+            {
+                //链接断开
+                [self relinkWebRtcFun];
+            }
+            break;
+        default:
+            break;
+    }
 }
 
-//-(void)onIceConnectedFromPeerName:(NSString*)peerName{
-//    HLog(@"onIceConnectedFromPeerName:%@",peerName);
-//    mainBlock(^{
-//        [self removeNewIndicator];
-//    });
-//}
-
+-(void)onChannelDataFromPeerName:(NSString*)peerName buffer:(RTC_OBJC_TYPE(RTCDataBuffer) *)buffer
+{
+    //HLog(@"onIceConnectedFromPeerName:%@",buffer.data);
+    if(buffer && buffer.data){
+        KWeakSelf
+        mainBlock(^{
+            [weakSelf handleWebRtcMsgResponseBy:buffer.data];
+        });
+    }
+}
 
 -(void)didGetStats:(NSString*)peerName stats:(RTC_OBJC_TYPE(RTCStatisticsReport) *)stats {
-    HLog(@"stats:%@",stats);
+    HLog(@"推拉流 stats:%@",stats);
+}
+
+#pragma mark 收到的webrtc消息处理
+- (void)handleWebRtcMsgResponseBy:(NSData*)message
+{
+    if([message isKindOfClass:[NSMutableString class]] || [message isKindOfClass:[NSString class]])
+    {
+        message = [(NSString *)message dataUsingEncoding:(NSUTF8StringEncoding)];
+    }
+    
+    NSError *error = nil;
+    NSDictionary *dataDict = [NSJSONSerialization JSONObjectWithData:message options:NSJSONReadingMutableContainers error:&error];
+    HLog(@"webRtc 音视频推拉流 通道接收消息:------------------%@",dataDict);
+    
+    
+    if(!dataDict){
+        //[weakSelf handleDownloadResponseFunBy:message];
+        return;
+    }
+    
+    if(![dataDict isKindOfClass:[NSDictionary class]]){
+        //[__NSCFString allKeys] unrecognized selector sent to ins
+        return;
+    }
+    
+    if(![[dataDict allKeys] containsObject:@"type"]){
+        return;
+    }
+    
+    NSString *messageType = dataDict[@"type"];
+    
+    if ([messageType isEqualToString:@"login"]) {
+        
+        if([[dataDict allKeys] containsObject:@"value"]){
+            NSString *value = dataDict[@"value"];
+            [self LogoutByOtherFun:value];
+        }
+    }
 }
 @end