From 7f62f2d3bf626ac55d2d2de05ca1d71eaaabef39 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期四, 13 五月 2021 09:55:37 +0800
Subject: [PATCH] 2021-05-13 1.备份

---
 iOS/Xamarin/LCSDKOnXamarin/LCSDKOnXamarin/LCOnIntercomViewController.m |  122 +++++++++++++++++++++++-----------------
 1 files changed, 70 insertions(+), 52 deletions(-)

diff --git a/iOS/Xamarin/LCSDKOnXamarin/LCSDKOnXamarin/LCOnIntercomViewController.m b/iOS/Xamarin/LCSDKOnXamarin/LCSDKOnXamarin/LCOnIntercomViewController.m
index 6ef9962..8942409 100644
--- a/iOS/Xamarin/LCSDKOnXamarin/LCSDKOnXamarin/LCOnIntercomViewController.m
+++ b/iOS/Xamarin/LCSDKOnXamarin/LCSDKOnXamarin/LCOnIntercomViewController.m
@@ -9,7 +9,9 @@
 #import <AVFoundation/AVFoundation.h>
 #import <Photos/Photos.h>
 #import <AudioToolbox/AudioToolbox.h>
-#import "LCKit.h"
+#import "LCUtlis.h"
+#import "LCApiKit.h"
+#import <LCOpenSDKDynamic/LCOpenSDKDynamic.h>
 
 @interface LCOnIntercomViewController ()<LCOpenSDK_EventListener, LCOpenSDK_TalkerListener>
 
@@ -90,8 +92,11 @@
     //寮�濮嬪弽鍛�
     [self StartReverseCall];
     [self ShowCalltimeBtn:callingStr];
-    //鏆傛椂涓嶆敮鎸佸紑閿佸姛鑳�
-    [self setUnlock:NO];
+//    //鏆傛椂涓嶆敮鎸佸紑閿佸姛鑳�
+//    [self setUnlock:NO];
+    //娉ㄥ唽寮�閿佹垚鍔熺洃鍚�
+    [self addOpenSuccessAction];
+    
     // Do any additional setup after loading the view.
 }
 
@@ -282,11 +287,10 @@
 
 -(void)unlockAction{
     [_unlockImgBtn setImage:[UIImage imageNamed:@"ic_esvideo_on_unlock_unselect"] forState:UIControlStateNormal];
-    //    //寮�閿�
-    //    if(_es){
-    //        [_es openTheDoorWithRoomid:_mESRoomID];
-    //    }
-    
+    //寮�閿�
+    if(self.mLCCallDelegate != NULL){
+       [self.mLCCallDelegate onUnlockAction];
+    }
 }
 
 #pragma 鎸傛柇鍜屽紑閿�
@@ -305,13 +309,13 @@
 //鎸傛柇鎸夐挳浜嬩欢
 -(void)hangUpAction{
     //1.鍥炶皟浜嬩欢
-    if(self.mESCallDelegate != NULL){
+    if(self.mLCCallDelegate != NULL){
         if(isAnswer){
             //濡傛灉涔嬪墠宸茬粡鎺ュ惉浜嗭紝鍥炶皟鏄寕鏂�
-            [self.mESCallDelegate onHangUpAction:_callTimeout];
+            [self.mLCCallDelegate onHangUpAction:_callTimeout];
         }else{
             //濡傛灉涔嬪墠娌℃帴鍚簡锛屽洖璋冩槸鎷掓帴
-            [self.mESCallDelegate onRejectCallAction];
+            [self.mLCCallDelegate onRejectCallAction];
         }
     }
     //2.椤甸潰鍏抽棴
@@ -350,7 +354,7 @@
     [self stopPlaySystemSound];
     /// 寮�鍚璁�
     [self startTalk];
-
+    
     _answerImgBtn.hidden = YES;
     _answerTextBtn.hidden = YES;
     
@@ -364,8 +368,8 @@
     [self startCountdown];
     isAnswer = YES;
     
-    if(self.mESCallDelegate != NULL){
-        [self.mESCallDelegate onAnswerAction];
+    if(self.mLCCallDelegate != NULL){
+        [self.mLCCallDelegate onAnswerAction];
     }
     
 }
@@ -503,10 +507,7 @@
     _openDoorTimeout = 0;
     [self startOpenDoorCountdown];
     [self showUIAlertView:unlockSuccessfullyStr];
-    // 寮�閿佹垚鍔熷洖璋�
-    if(self.mESCallDelegate != NULL){
-        [self.mESCallDelegate onUnlockAction];
-    }
+    
 }
 
 -(void)setUnlock:(BOOL)ISEnable{
@@ -653,7 +654,7 @@
 - (void)startTalk {
     if (!isAnswer) {
         //瀵硅寮�鍚�
-//        [self.playWindow stopAudio];
+        //        [self.playWindow stopAudio];
         
         if(self.talker == NULL) return;
         
@@ -726,13 +727,13 @@
         if (type == 0) {
             
             if ([RTSP_Result_String(STATE_RTSP_DESCRIBE_READY) isEqualToString:code]) {
-//                dispatch_async(dispatch_get_main_queue(), ^{
-//                });
+                //                dispatch_async(dispatch_get_main_queue(), ^{
+                //                });
                 return;
             }
             if ([RTSP_Result_String(STATE_RTSP_PLAY_READY) isEqualToString:code]) {
-//                dispatch_async(dispatch_get_main_queue(), ^{
-//                });
+                //                dispatch_async(dispatch_get_main_queue(), ^{
+                //                });
                 return;
             }
             //鎻愮ず澶辫触
@@ -764,31 +765,31 @@
     dispatch_async(dispatch_get_main_queue(), ^{
         NSLog(@"寮�鍚璁插洖璋僥rror = %@, type = %ld", error, (long)type);
         WEAKSELF_AT(self);
-//        [LCProgressHUD hideAllHuds:nil];
-//        if (99 == type) {   //缃戠粶璇锋眰澶辫触
-////            dispatch_async(dispatch_get_main_queue(), ^{
-////                weakself.videoManager.isOpenAudioTalk = NO;
-////                [LCProgressHUD showMsg:@"play_module_video_preview_talk_failed".lc_T];
-////            });
-//            return;
-//        }
-//        if (nil != error && [RTSP_Result_String(STATE_RTSP_DESCRIBE_READY) isEqualToString:error]) {
-//            dispatch_async(dispatch_get_main_queue(), ^{
-//            });
-//            return;
-//        }
-//        if (nil != error && [RTSP_Result_String(STATE_RTSP_PLAY_READY) isEqualToString:error]) {
-//            dispatch_async(dispatch_get_main_queue(), ^{
-//                //瀵硅杩炴帴鎴愬姛寤虹珛
-//                self.videoManager.isOpenAudioTalk = YES;
-//                [LCProgressHUD showMsg:@"device_mid_open_talk_success".lc_T];
-//            });
-//            return;
-//        }
-//        dispatch_async(dispatch_get_main_queue(), ^{
-//            [LCProgressHUD showMsg:@"play_module_video_preview_talk_failed".lc_T];
-//            weakself.videoManager.isOpenAudioTalk = NO;
-//        });
+        //        [LCProgressHUD hideAllHuds:nil];
+        //        if (99 == type) {   //缃戠粶璇锋眰澶辫触
+        ////            dispatch_async(dispatch_get_main_queue(), ^{
+        ////                weakself.videoManager.isOpenAudioTalk = NO;
+        ////                [LCProgressHUD showMsg:@"play_module_video_preview_talk_failed".lc_T];
+        ////            });
+        //            return;
+        //        }
+        //        if (nil != error && [RTSP_Result_String(STATE_RTSP_DESCRIBE_READY) isEqualToString:error]) {
+        //            dispatch_async(dispatch_get_main_queue(), ^{
+        //            });
+        //            return;
+        //        }
+        //        if (nil != error && [RTSP_Result_String(STATE_RTSP_PLAY_READY) isEqualToString:error]) {
+        //            dispatch_async(dispatch_get_main_queue(), ^{
+        //                //瀵硅杩炴帴鎴愬姛寤虹珛
+        //                self.videoManager.isOpenAudioTalk = YES;
+        //                [LCProgressHUD showMsg:@"device_mid_open_talk_success".lc_T];
+        //            });
+        //            return;
+        //        }
+        //        dispatch_async(dispatch_get_main_queue(), ^{
+        //            [LCProgressHUD showMsg:@"play_module_video_preview_talk_failed".lc_T];
+        //            weakself.videoManager.isOpenAudioTalk = NO;
+        //        });
     });
 }
 
@@ -1025,8 +1026,8 @@
     if (!error) {
         message = saveToTheAlbumsStr;
         // 鎴浘鎴愬姛鍥炶皟
-        if(self.mESCallDelegate != NULL){
-            [self.mESCallDelegate onScreenshotSuccessfulAction:image];
+        if(self.mLCCallDelegate != NULL){
+            [self.mLCCallDelegate onScreenshotSuccessfulAction:image];
         }
     }
     else
@@ -1079,7 +1080,7 @@
 //寮�濮嬫挱鏀剧殑鏃跺�欒皟鐢�
 -(void)startPlaySystemSound{
     
-//    return;
+    //    return;
     //    //闇囧姩鐨勬彁绀烘枃浠跺悕鏀惧埌璧勬簮鐩綍涓�
     //    NSString *path = [[NSBundle mainBundle] pathForResource:@"ring" ofType:@"wav"];
     //    AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:path], &sound);
@@ -1092,7 +1093,7 @@
 
 //鎵嬪姩鍋滄鎾斁鐨勬椂鍊欒皟鐢�
 - (void)stopPlaySystemSound{
-//    return;
+    //    return;
     NSLog(@"stop PlaySystemSound");
     stopRingAndVibration();
 }
@@ -1119,8 +1120,25 @@
 //}
 
 
+///
+- (void)addOpenSuccessAction {
 
+    [[NSNotificationCenter defaultCenter] removeObserver:self
+                                                    name:LCCallDelegateOpenDoorSuccess
+                                                  object:nil];
 
+    [[NSNotificationCenter defaultCenter] addObserver:self
+                                             selector:@selector(setOpenDoorSuccess)
+                                                 name:LCCallDelegateOpenDoorSuccess
+                                               object:nil];
+}
+
+- (void)removeOpenSuccessAction {
+
+    [[NSNotificationCenter defaultCenter] removeObserver:self
+                                                    name:LCCallDelegateOpenDoorSuccess
+                                                  object:nil];
+}
 
 @end
 

--
Gitblit v1.8.0