From cb9232b3ab413fae7bcc2b94abd70f18ca02b263 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 03 十二月 2024 11:20:32 +0800
Subject: [PATCH] 增加铃声;增加TCP/UDP连接选择

---
 HDLLinPhoneSDK(OC)/HDLLinPhoneSDK/HDLLPOnMonitorViewController.m |   40 ++++++++++++++++++++++++++++++++--------
 1 files changed, 32 insertions(+), 8 deletions(-)

diff --git "a/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLPOnMonitorViewController.m" "b/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLPOnMonitorViewController.m"
index 2e13e73..95309f1 100644
--- "a/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLPOnMonitorViewController.m"
+++ "b/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLPOnMonitorViewController.m"
@@ -58,6 +58,8 @@
     
     NSString * LCSdkToken;
     NSString * LCHostApi;
+    NSString * cancelStr;
+    NSString * tipMsgStr;
     
     CGFloat Height66;
     bool isShowErrorAlert;
@@ -75,7 +77,7 @@
     [self initData];
     [self initESVideo];
     [self StartMonitoring];
-//    [HDLLinphoneManager.instance enableMicro:false];
+    [HDLLinphoneManager.instance enableMicro:false];
     
 //    //鏆傛椂涓嶆敮鎸佸紑閿佸姛鑳�
 //    [self setUnlock:NO];
@@ -102,7 +104,7 @@
     if ((state == LinphoneCallEnd || state == LinphoneCallError)){//鎸傛柇浜�
         NSLog(@"鎸傛柇鎴栧嚭閿欎簡");
         self.isHangUpByRemote=YES;
-        [self showUIAlertViewWithBack:@"鐩戣缁撴潫"];
+        [self showUIAlertViewWithBack:endOfMonitoringStr];
         
     }
 }
@@ -120,6 +122,8 @@
         unlockStr = @"寮�閿�";
         endOfMonitoringStr = @"鐩戣缁撴潫";
         unlockSuccessfullyStr = @"寮�閿佹垚鍔�";
+        cancelStr = @"鍙栨秷";
+        tipMsgStr = @"纭畾寮�閿佸悧?";
         
     }else{
         tipStr = @"Prompt";
@@ -130,6 +134,8 @@
         unlockStr = @"Unlock";
         endOfMonitoringStr = @"End of monitoring";
         unlockSuccessfullyStr = @"Unlock successfully";
+        cancelStr = @"Cancel";
+        tipMsgStr = @"Are you sure to unlock?";
     }
     
     
@@ -219,11 +225,13 @@
 -(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;
         _videoView.layer.shadowRadius = 0;
+        _videoView.layer.masksToBounds=YES;
     }
     return _videoView;
 }
@@ -256,9 +264,6 @@
     [_screenshotTextBtn setTitleColor:TextColor forState:UIControlStateNormal];
     NSLog(@"鎴浘");
     //鎴浘
-//    if(self.playWindow){
-//        [self saveThumbImage];
-//    }
     [HDLLinphoneManager.instance snapShotWithView:self.videoView];
     
 }
@@ -304,7 +309,26 @@
     [_unlockTextBtn setTitleColor:TextColor 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];
     }
     
 }
@@ -423,7 +447,7 @@
  寮�濮嬬洃鎺�
  */
 -(void)StartMonitoring{
-    NSLog(@"寮�濮嬪懠鍙細@%@",self.userName);
+    NSLog(@"寮�濮嬪懠鍙細%@",self.userName);
     [HDLLinphoneManager.instance startCall:self.userName];
     
 }

--
Gitblit v1.8.0