From c2cae389c932a9ab2c03d67d0276376655f26343 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 06 八月 2024 14:17:04 +0800
Subject: [PATCH] OnPro(安卓/IOS)可视对讲 TCP UDP连接选择 ;自动切换服务器

---
 HDL_ON/Common/HDLCommon.cs |   42 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index 0d7c969..db3372f 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -7,7 +7,10 @@
 using HDL_ON.Entity;
 using System.Threading;
 using HDL_ON.DriverLayer;
-
+#if __IOS__
+using Other;
+using Shared.IOS.HDLLinphoneSDK;
+#endif
 namespace HDL_ON
 {
     /// <summary>
@@ -373,7 +376,7 @@
 
 
 #if __ANDROID__
-                            Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MissedCallsTime = 10;
+                            Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MissedCallsTime = 30;
                             Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.SetMediaPlayerLooping(true);
                             Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.PlayRingtone();
                             new Thread(() =>
@@ -397,6 +400,41 @@
                                 }
                             })
                             { IsBackground = true }.Start();
+
+#elif __IOS__
+                            SoundPlayer.Ins.PlaySound();
+                            new Thread(() => {
+                                int count = 0;
+                                while (true)
+                                {
+                                    if (SoundPlayer.Ins.player == null)
+                                    {
+                                        break;
+                                    }
+                                    if (!SoundPlayer.Ins.player.Playing)
+                                    {
+                                        break;
+                                    }
+                                    System.Threading.Thread.Sleep(1000);
+                                    count++;
+                                    MainPage.Log("linphone 鍛煎彨璁℃椂锛�" + count);
+                                    if (count > 29)
+                                    {
+                                        SoundPlayer.Ins.StopSound();
+                                        Application.RunOnMainThread(() => {
+                                            try
+                                            {
+                                                HDLLinPhoneSDK.Instance().HideIntercomeVC();
+                                            }catch(Exception ex)
+                                            {
+                                                MainPage.Log("error", "ios linphone 鍛煎彨瓒呮椂鍏抽棴鐣岄潰寮傚父锛�" + ex.Message);
+                                            }
+                                        });
+                                        break;
+                                    }
+                                }
+                            })
+                            { IsBackground = true }.Start();
 #endif
 
 

--
Gitblit v1.8.0