From ea4b1f379fa052b1e044e1d67e85a8500cbd86ff Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期五, 02 八月 2024 17:01:15 +0800 Subject: [PATCH] 可视对讲铃声功能 --- HDL_ON/Common/HDLCommon.cs | 35 ++++++++++++++++++++++++++++++++++- 1 files changed, 34 insertions(+), 1 deletions(-) diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs index d99e10b..0d7c969 100644 --- a/HDL_ON/Common/HDLCommon.cs +++ b/HDL_ON/Common/HDLCommon.cs @@ -7,6 +7,7 @@ using HDL_ON.Entity; using System.Threading; using HDL_ON.DriverLayer; + namespace HDL_ON { /// <summary> @@ -305,7 +306,7 @@ ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo, InterphoneType.FLVI.ToString()); } - else if (jpushMessageInfo.messageType == (PushMessageType.HDL_INTERPHONE.ToString())) + else if (jpushMessageInfo.messageType == PushMessageType.HDL_INTERPHONE.ToString()) { if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return; @@ -368,6 +369,37 @@ } } catch { } + + + +#if __ANDROID__ + Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MissedCallsTime = 10; + Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.SetMediaPlayerLooping(true); + Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.PlayRingtone(); + new Thread(() => + { + try + { + DateTime dateTime = DateTime.Now; + while (true) + { + Thread.Sleep(1000); + if (!Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MediaPlayerPlayingStatus || dateTime.AddSeconds(Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.MissedCallsTime) <= DateTime.Now) + { + break; + } + } + Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.SetMediaPlayerLooping(false); + } + catch (Exception ex) + { + MainPage.Log("error", "鑷爺鍙瀵硅閾冨0鎾斁寮傚父:" + ex.Message); + } + }) + { IsBackground = true }.Start(); +#endif + + //HDL Linphone 鐙勮�愬厠 eSVideoInfo.HomeId = jpushMessageInfo.HomeId; eSVideoInfo.callId = json["callId"].ToString(); @@ -376,6 +408,7 @@ eSVideoInfo.deviceSipAccount = json["deviceSipAccount"].ToString(); eSVideoInfo.spk = json["spk"].ToString(); + //ShowAlert("鐙勮�愬厠闂ㄥ彛鏈哄懠鍙�"); //鎵撳紑鍛煎彨椤甸潰 HDLLinphone.Current.ShowESVideoIntercom(eSVideoInfo, InterphoneType.HDL.ToString()); -- Gitblit v1.8.0