From be56723cce4cd60ddc144ebe6ac20607675b3006 Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期三, 17 七月 2024 09:33:38 +0800 Subject: [PATCH] 更新sdk --- HDLLinPhoneSDK(OC)/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m | 74 ++++++++++++++++++++++++++++--------- 1 files changed, 56 insertions(+), 18 deletions(-) diff --git "a/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m" "b/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m" index 2b91526..ef51c36 100644 --- "a/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m" +++ "b/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m" @@ -53,6 +53,11 @@ NSString * callingStr; NSString * hangUpStr; NSString * endOfCallStr; + + + NSString * cancelStr; + NSString * tipMsgStr; + // int openDoorTimeout; //鍏ㄥ眬鍙橀噺 SystemSoundID sound; @@ -121,6 +126,8 @@ unlockSuccessfullyStr = @"寮�閿佹垚鍔�"; callingStr = @"鏉ョ數涓�..."; endOfCallStr = @"閫氳瘽缁撴潫"; + cancelStr = @"鍙栨秷"; + tipMsgStr = @"纭畾寮�閿佸悧?"; }else{ tipStr = @"Prompt"; okStr = @"OK"; @@ -132,6 +139,8 @@ unlockSuccessfullyStr = @"Unlock successfully"; callingStr = @"Incoming call"; endOfCallStr = @"End of call"; + cancelStr = @"Cancel"; + tipMsgStr = @"Are you sure to unlock?"; } } @@ -219,7 +228,8 @@ -(UIView *)videoView{ if (_videoView == Nil) { _videoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, GetRealWidth(210))]; - _videoView.backgroundColor = UIColor.lightGrayColor; +// _videoView.backgroundColor = UIColor.lightGrayColor; + _videoView.backgroundColor = UIColor.blackColor; _videoView.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.25].CGColor; _videoView.layer.shadowOffset = CGSizeMake(0,0.5); _videoView.layer.shadowOpacity = 1; @@ -290,7 +300,27 @@ [_unlockImgBtn setImage:[UIImage imageNamed:@"ic_esvideo_on_unlock_unselect"] forState:UIControlStateNormal]; //寮�閿� if(self.hdlLinphoneCallDelegate != NULL){ - [self.hdlLinphoneCallDelegate onUnlockAction]; + + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:tipStr message:tipMsgStr preferredStyle:UIAlertControllerStyleAlert]; + + // 娣诲姞鍙栨秷鎸夐挳 + UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancelStr style:UIAlertActionStyleCancel handler:nil]; + [alertController addAction:cancelAction]; + + // 娣诲姞纭鎸夐挳 + WEAKSELF_AT + UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:okStr style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + + [weakSelf_AT.hdlLinphoneCallDelegate onUnlockAction]; + }]; + [alertController addAction:confirmAction]; + + // 鑾峰彇褰撳墠瑙嗗浘鎺у埗鍣� + UIViewController *currentViewController = [UIApplication sharedApplication].keyWindow.rootViewController; + + // 鏄剧ず寮圭獥 + [self presentViewController:alertController animated:YES completion:nil]; + } } @@ -357,7 +387,15 @@ [self stopPlaySystemSound]; // [[HDLCallManager instance] acceptCallByCallID:self.CallId hasVideo:self.hasVideo]; - [[HDLLinphoneManager instance] acceptCall]; + [HDLLinphoneManager.instance enableMicro:true]; + if (self.deviceType==HDLLPType_HDLSR) { + NSLog(@"鍙嶅懠"); + [HDLLinphoneManager.instance startCall:self.userName]; + }else{ + NSLog(@"鎺ュ惉"); + [[HDLLinphoneManager instance] acceptCall]; + + } /// 寮�鍚璁� // [self startTalk]; @@ -475,9 +513,9 @@ /** 寮�鍚�掕鏃� */ - (void)startCountdown { - if (_callTimeout > 100) { - return; - } +// if (_callTimeout > 100) { +// return; +// } _callTimeout = 0; // GCD瀹氭椂鍣� dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); @@ -488,24 +526,24 @@ dispatch_source_set_event_handler(_countdownTimer, ^{ WEAKSELF_AT - if(weakSelf_AT.callTimeout >= 100 ){// 璁℃椂缁撴潫 - // 鍏抽棴瀹氭椂鍣� - dispatch_source_cancel(weakSelf_AT.countdownTimer); - - dispatch_async(dispatch_get_main_queue(), ^{ - NSLog(@"瓒呮椂"); - [weakSelf_AT backAction]; - - }); - - }else{// 璁℃椂涓� +// if(weakSelf_AT.callTimeout >= 100 ){// 璁℃椂缁撴潫 +// // 鍏抽棴瀹氭椂鍣� +// dispatch_source_cancel(weakSelf_AT.countdownTimer); +// +// dispatch_async(dispatch_get_main_queue(), ^{ +// NSLog(@"瓒呮椂"); +// [weakSelf_AT backAction]; +// +// }); +// +// }else{// 璁℃椂涓� weakSelf_AT.callTimeout++; dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf_AT ShowTime:weakSelf_AT.callTimeout]; }); - } +// } }); // 寮�鍚畾鏃跺櫒 -- Gitblit v1.8.0