From 65150ff832383e25f31d20837ad97f77d2338979 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 02 四月 2021 09:05:38 +0800
Subject: [PATCH] 2021-04-02 1.更新丰林最新SDK

---
 On+/xamarin/ESVideoOnXamarin/ESVideoOnXamarin/ESOnIntercomViewController.m |   48 +++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/On+/xamarin/ESVideoOnXamarin/ESVideoOnXamarin/ESOnIntercomViewController.m b/On+/xamarin/ESVideoOnXamarin/ESVideoOnXamarin/ESOnIntercomViewController.m
index 8286472..ce4c850 100644
--- a/On+/xamarin/ESVideoOnXamarin/ESVideoOnXamarin/ESOnIntercomViewController.m
+++ b/On+/xamarin/ESVideoOnXamarin/ESVideoOnXamarin/ESOnIntercomViewController.m
@@ -11,7 +11,7 @@
 #import <AVFoundation/AVFoundation.h>
 #import <ESVideoPhoneSDk/ESVideoPhone.h>
 #import <ESVideoPhoneSDk/ESError.h>
-#import "AudioSessionHelper.h"
+//#import "AudioSessionHelper.h"
 #import <Photos/Photos.h>
 #import <AudioToolbox/AudioToolbox.h>
 #import "ESVideo.h"
@@ -20,7 +20,7 @@
 
 @interface ESOnIntercomViewController ()<ESVideoPhoneDelegate>
 
-@property (nonatomic,strong) AudioSessionHelper    *sessionHelper;
+//@property (nonatomic,strong) AudioSessionHelper    *sessionHelper;
 @property (nonatomic,strong) ESVideoPhone          *es;
 @property (nonatomic,assign) BOOL                  playing;
 @property (nonatomic,assign) BOOL                  isInterrupt;
@@ -61,6 +61,7 @@
     BOOL isBackGround;
     BOOL iSVideoNotDetermined;
     BOOL iSAudioNotDetermined;
+    BOOL isAnswer;//鏄惁宸茬粡鐐瑰嚮鎺ュ惉杩囦簡
     
     NSString * tipStr;
     NSString * okStr;
@@ -301,6 +302,17 @@
 
 //鎸傛柇鎸夐挳浜嬩欢
 -(void)hangUpAction{
+    //1.鍥炶皟浜嬩欢
+    if(self.mESCallDelegate != NULL){
+        if(isAnswer){
+            //濡傛灉涔嬪墠宸茬粡鎺ュ惉浜嗭紝鍥炶皟鏄寕鏂�
+            [self.mESCallDelegate onHangUpAction:_callTimeout];
+        }else{
+            //濡傛灉涔嬪墠娌℃帴鍚簡锛屽洖璋冩槸鎷掓帴
+            [self.mESCallDelegate onRejectCallAction];
+        }
+    }
+    //2.椤甸潰鍏抽棴
     [self backAction];
 }
 
@@ -352,6 +364,11 @@
     //寮�濮嬭鏃�
     _callTimeout = 0;
     [self startCountdown];
+    isAnswer = YES;
+    
+    if(self.mESCallDelegate != NULL){
+        [self.mESCallDelegate onAnswerAction];
+    }
     
 }
 
@@ -488,8 +505,10 @@
     _openDoorTimeout = 0;
     [self startOpenDoorCountdown];
     [self showUIAlertView:unlockSuccessfullyStr];
-    
-    
+    // 寮�閿佹垚鍔熷洖璋�
+    if(self.mESCallDelegate != NULL){
+        [self.mESCallDelegate onUnlockAction];
+    }
 }
 
 -(void)setUnlock:(BOOL)ISEnable{
@@ -590,9 +609,9 @@
 //            NSLog(@"VideoCaptureSession 鍒濆鍖栧け璐�");
 //        }
 //    }
-    //鍒濆鍖朅udioSession
-    _sessionHelper = [[AudioSessionHelper alloc]init];
-    [_sessionHelper setAudioSession];
+//    //鍒濆鍖朅udioSession
+//    _sessionHelper = [[AudioSessionHelper alloc]init];
+//    [_sessionHelper setAudioSession];
     //娣诲姞杩涘叆鍚庡彴锛屼腑鏂瓑閫氱煡
     [self addObservers];
     
@@ -800,7 +819,7 @@
     // If media services were reset, and the last start succeeded, restart the session.
     if (error.code == AVErrorMediaServicesWereReset) {
         [_es onStopCapture];
-        [_es startTalk];
+        [_es stopTalk];
     }
 }
 
@@ -914,13 +933,16 @@
     NSString *result = nil;
     //鍚瓛鐘舵�� 鎻掕�冲鍚庢嫈鎺夊悗鎭㈠鍒伴粯璁よ缃�
     if (sender == nil) {
-        result = [_sessionHelper speaker:NO];
+//        result = [_sessionHelper speaker:NO];
+        [_es resetAudioCaptureIsSpeak:NO];
     }else{
         if(!_isSpeaking){
-            result = [_sessionHelper speaker:YES];
+            [_es resetAudioCaptureIsSpeak:YES];
+//            result = [_sessionHelper speaker:YES];
             _isSpeaking = YES;
         }else{
-            result = [_sessionHelper speaker:NO];
+//            result = [_sessionHelper speaker:NO];
+            [_es resetAudioCaptureIsSpeak:NO];
             _isSpeaking = NO;
         }
     }
@@ -1110,6 +1132,10 @@
     NSString *message = nil;
     if (!error) {
         message = saveToTheAlbumsStr;
+        // 鎴浘鎴愬姛鍥炶皟
+        if(self.mESCallDelegate != NULL){
+            [self.mESCallDelegate onScreenshotSuccessfulAction:image];
+        }
     }
     else
     {

--
Gitblit v1.8.0