| | |
| | | using HDL_ON.Entity; |
| | | using System.Threading; |
| | | using HDL_ON.DriverLayer; |
| | | |
| | | #if __IOS__ |
| | | using Other; |
| | | using Shared.IOS.HDLLinphoneSDK; |
| | | #endif |
| | | namespace HDL_ON |
| | | { |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | #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(() => |
| | |
| | | } |
| | | }) |
| | | { 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 |
| | | |
| | | |