From eda3fb873e59544ff36301b51e05aef64f87b0f9 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期五, 27 八月 2021 13:21:21 +0800 Subject: [PATCH] Merge branch 'newBranch1' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into newBranch1 --- HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs | 588 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 512 insertions(+), 76 deletions(-) diff --git a/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs b/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs index 6b310f0..df8612f 100644 --- a/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs +++ b/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs @@ -3,9 +3,12 @@ using HDL_ON.DAL.Server; using System.Threading; using System.Collections.Generic; +using HDL_ON.UI.UI2.PersonalCenter.PirDevice; +using HDL_ON.Entity; #if __IOS__ using Shared.IOS.ESVideoOnSDK; +using Shared.IOS.LCVideoOnSDK; using UIKit; using Foundation; #else @@ -46,7 +49,7 @@ public ESVideoInfo esVideoInfo; /// <summary> - /// + /// 鏆傛椂娌$敤 /// </summary> public void InitESVideoSDK() { @@ -57,72 +60,272 @@ /// 鐩戞帶椤甸潰 /// </summary> /// <param name="mESVideoInfo"></param> - public void ShowESVideoMonitor(ESVideoInfo mESVideoInfo) + public void ShowESVideoMonitor(ESVideoInfo mESVideoInfo, string interphoneType) { this.esVideoInfo = mESVideoInfo; + int roomID = 0; + int.TryParse(mESVideoInfo.roomno, out roomID); #if __IOS__ - ESOnMonitorViewController vc = new ESOnMonitorViewController(); - vc.MESVideoID = mESVideoInfo.ESVideoUUID; - //vc.MESRoomID = mESVideoInfo.ESRoomID; - vc.DeviceName = mESVideoInfo.DeviceName; - //vc.RoomName = mESVideoInfo.RoomName; - vc.MESCallDelegate = new OnESCallDelegate(this); - Shared.Application.currentVC.NavigationController.PushViewController(vc, true); -#else + if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) + { + //涔愭鍙瀵硅 + //1.鍒濆鍖朙COpenSDK_Api + LCApiKit.SharedInstance().IsChinaMainland = OnAppConfig.Instance.RequestHttpsHost.Contains("china");//濡傛灉鍩熷悕鍖呭惈china锛屽垯SDK 浣跨敤涔愭鐨勪腑鍥藉ぇ闄�(姝e紡)鍩熷悕 + LCApiKit.SharedInstance().InitSDKOpenApi(mESVideoInfo.Lc_AccessToken); + LCApiKit.SharedInstance().CurrentDevicePlayToken = mESVideoInfo.Lc_PlayToken; + LCApiKit.SharedInstance().CurrentDeviceId = mESVideoInfo.Lc_DeviceId; + LCApiKit.SharedInstance().CurrentDeviceName = mESVideoInfo.DeviceName; + LCApiKit.SharedInstance().CurrentPsk = mESVideoInfo.Lc_DeviceId; + //2.璋冩暣鐩戣椤甸潰 + LCOnMonitorViewController vc = new LCOnMonitorViewController(); + mOnLCCallDelegate = new OnLCCallDelegate(this); + vc.MLCCallDelegate = mOnLCCallDelegate; + //vc.MLCCallDelegate = new OnLCCallDelegate(this); + Shared.Application.currentVC.NavigationController.PushViewController(vc, true); + } + else if(interphoneType == InterphoneType.FLVI.ToString()) + { - Intent intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); - intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); - intent.PutExtra("uuid", mESVideoInfo.uuid); - intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); - intent.PutExtra("cmtID", mESVideoInfo.cmtID); - intent.PutExtra("roomno", mESVideoInfo.roomno); - intent.PutExtra("unitno", mESVideoInfo.unitno); - intent.PutExtra("HomeID", mESVideoInfo.HomeID); - intent.PutExtra("callId", mESVideoInfo.callId); - intent.PutExtra("Type", 0); - Shared.Application.Activity.StartActivity(intent); + ESOnMonitorViewController vc = new ESOnMonitorViewController(); + vc.MESVideoID = mESVideoInfo.ESVideoUUID; + vc.MESRoomID = roomID; + vc.DeviceName = mESVideoInfo.DeviceName; + //vc.RoomName = mESVideoInfo.RoomName; + //vc.MESCallDelegate = new OnESCallDelegate(this); + Shared.Application.currentVC.NavigationController.PushViewController(vc, true); + }else if (interphoneType == InterphoneType.HDL.ToString()) + { + //HDLLinphone 鐙勮�愬厠 + HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo); + } + else + { + HDLUtils.WriteLine("鏈鎺ワ紝涓嶆敮鎸佺洃瑙�"); + } +#else + Intent intent = null; + if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) + { + intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.LeChengVideoActivity)); + intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); + intent.PutExtra("uuid", mESVideoInfo.uuid); + intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); + intent.PutExtra("cmtID", mESVideoInfo.cmtID); + intent.PutExtra("roomno", mESVideoInfo.roomno); + intent.PutExtra("unitno", mESVideoInfo.unitno); + intent.PutExtra("HomeID", PirSend.HomeId); + intent.PutExtra("callId", mESVideoInfo.callId); + intent.PutExtra("Type", 0); + + //=========涔愭========== + intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken); + intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId); + intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("china") ? 0 : 1);//濡傛灉鍩熷悕鍖呭惈china锛屽垯鏄浗鍐呰处鍙�); + intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken); + intent.PutExtra("Psk", mESVideoInfo.Lc_Psk); + + Shared.Application.Activity.StartActivity(intent); + } + else if (interphoneType == InterphoneType.FLVI.ToString()) + { + + intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); + intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); + intent.PutExtra("uuid", mESVideoInfo.uuid); + intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); + intent.PutExtra("cmtID", mESVideoInfo.cmtID); + intent.PutExtra("roomno", mESVideoInfo.roomno); + intent.PutExtra("unitno", mESVideoInfo.unitno); + intent.PutExtra("HomeID", PirSend.HomeId); + intent.PutExtra("callId", mESVideoInfo.callId); + intent.PutExtra("Type", 0); + + //=========涔愭========== + intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken); + intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId); + intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("china") ? 0 : 1);//濡傛灉鍩熷悕鍖呭惈china锛屽垯鏄浗鍐呰处鍙�); + intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken); + intent.PutExtra("Psk", mESVideoInfo.Lc_Psk); + + Shared.Application.Activity.StartActivity(intent); + } + else if (interphoneType == InterphoneType.HDL.ToString()) + { + //HDLLinphone 鐙勮�愬厠 + HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo); + } + else + { + HDLUtils.WriteLine("鏈鎺ワ紝涓嶆敮鎸佺洃瑙�"); + } + + #endif } - - /// <summary> /// 琚懠鍙〉闈� /// </summary> /// <param name="mESVideoInfo"></param> - public void ShowESvideoVideoIntercom(ESVideoInfo mESVideoInfo) + public void ShowESvideoVideoIntercom(ESVideoInfo mESVideoInfo, string interphoneType) { this.esVideoInfo = mESVideoInfo; + int roomID = 0; + int.TryParse(mESVideoInfo.roomno, out roomID); #if __IOS__ - ESOnIntercomViewController vc = new ESOnIntercomViewController(); - vc.MESVideoID = mESVideoInfo.ESVideoUUID; - //vc.MESRoomID = mESVideoInfo.ESRoomID; - vc.DeviceName = mESVideoInfo.DeviceName; - //vc.RoomName = mESVideoInfo.RoomName; - //vc.MESCallDelegate = new OnESCallDelegate(this); - mOnESCallDelegate = new OnESCallDelegate(this); - vc.MESCallDelegate = mOnESCallDelegate; - Shared.Application.currentVC.NavigationController.PushViewController(vc, true); + if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) + { + //涔愭鍙瀵硅 + //1.鍒濆鍖朙COpenSDK_Api + LCApiKit.SharedInstance().IsChinaMainland = OnAppConfig.Instance.RequestHttpsHost.Contains("china");//濡傛灉鍩熷悕鍖呭惈china锛屽垯SDK 浣跨敤涔愭鐨勪腑鍥藉ぇ闄�(姝e紡)鍩熷悕 + LCApiKit.SharedInstance().InitSDKOpenApi(mESVideoInfo.Lc_AccessToken); + //2021-05-18 鐩墠鎺ㄩ�佺殑PlayToken;鏈夐棶棰樹細瀵艰嚧SDK宕╂簝锛屾殏鏃朵笉浼� + //LCApiKit.SharedInstance().CurrentDevicePlayToken = mESVideoInfo.Lc_PlayToken; + LCApiKit.SharedInstance().CurrentDeviceId = mESVideoInfo.Lc_DeviceId; + LCApiKit.SharedInstance().CurrentDeviceName = mESVideoInfo.DeviceName; + LCApiKit.SharedInstance().CurrentPsk = mESVideoInfo.Lc_DeviceId; + //2.璺宠浆涔愭鍛煎彨椤甸潰 + LCOnIntercomViewController vc = new LCOnIntercomViewController(); + mOnLCCallDelegate = new OnLCCallDelegate(this); + vc.MLCCallDelegate = mOnLCCallDelegate; + //vc.MLCCallDelegate = new OnLCCallDelegate(this); + Shared.Application.currentVC.NavigationController.PushViewController(vc, true); + } + else if (interphoneType == InterphoneType.EZVIZ.ToString()) + { + //钀ょ煶鐚溂鍛煎彨 + //鍒濆鍖栬悿鐭充簯SDK锛屼腑鏂囧浗鍐卥ey銆佽嫳鏂囨捣澶杒ey 寮�鍙戣�呰处鍙蜂娇鐢ㄥ簲鐢ㄥ寘鍚嶇敵璇风殑APPKEY锛屼笉鍚屽寘鍚嶅簲鐢ㄩ渶閰嶇疆涓嶅悓鐨凙PPKEY + EZSDK.IOS.EZSDK.SharedInstance().InitLibWithAppKey("1aa98a90489b4838b966b57018b4b04b", "1aa98a90489b4838b966b57018b4b04b"); + //1.璁剧疆鎵�闇�娌充笢鐨凙ccessToken鍜孯efreshToken銆佸煙鍚嶅湴鍧� + EZSDK.IOS.EZSDK.SharedInstance().SetHDlAccessToken(UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken); + + EZSDK.IOS.EZSDK.SharedInstance().SetRequestHttpsHostAndPlatform(OnAppConfig.Instance.RequestHttpsHost, 1, mESVideoInfo.HomeId); + //2.璁剧疆钀ょ煶瀛愯处鍙风殑AccessToken鍒癝DK + EZSDK.IOS.EZSDK.SharedInstance().SetEZAccessToken(mESVideoInfo.Lc_AccessToken); + //3.鎵撳紑瑙嗛鎾斁椤甸潰 + EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(mESVideoInfo.DeviceSerial); + + } + else if (interphoneType == InterphoneType.HDL.ToString()) + { + //HDL Linphone 鐙勮�愬厠 + + + } + else if (interphoneType == InterphoneType.FLVI.ToString()) + { + + ESOnIntercomViewController vc = new ESOnIntercomViewController(); + vc.MESVideoID = mESVideoInfo.ESVideoUUID; + vc.MESRoomID = roomID; + vc.DeviceName = mESVideoInfo.DeviceName; + //vc.RoomName = mESVideoInfo.RoomName; + //vc.MESCallDelegate = new OnESCallDelegate(this); + mOnESCallDelegate = new OnESCallDelegate(this); + vc.MESCallDelegate = mOnESCallDelegate; + Shared.Application.currentVC.NavigationController.PushViewController(vc, true); + }else{ + HDLUtils.WriteLine("鏈敮鎸佺殑鍙瀵硅绫诲瀷"); + + } #else + #region Android 澶勭悊 - Intent intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); - intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); - intent.PutExtra("uuid", mESVideoInfo.uuid); - intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); - intent.PutExtra("cmtID", mESVideoInfo.cmtID); - intent.PutExtra("roomno", mESVideoInfo.roomno); - intent.PutExtra("unitno", mESVideoInfo.unitno); - intent.PutExtra("HomeID", mESVideoInfo.HomeID); - intent.PutExtra("callId", mESVideoInfo.callId); - intent.PutExtra("Type", 1); - Shared.Application.Activity.StartActivity(intent); + Intent intent = null; + if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) + { + //寰呭垹鍑忎笉蹇呰鍙傛暟 + intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.LeChengVideoActivity)); + intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); + intent.PutExtra("uuid", mESVideoInfo.uuid); + intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); + intent.PutExtra("cmtID", mESVideoInfo.cmtID); + intent.PutExtra("roomno", mESVideoInfo.roomno); + intent.PutExtra("unitno", mESVideoInfo.unitno); + intent.PutExtra("HomeID", PirSend.HomeId); + intent.PutExtra("callId", mESVideoInfo.callId); + intent.PutExtra("Type", 1); + //=========涔愭========== + intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken); + intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId); + intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("china") ? 0 : 1);//濡傛灉鍩熷悕鍖呭惈china锛屽垯鏄浗鍐呰处鍙�); + intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken); + intent.PutExtra("Psk", mESVideoInfo.Lc_Psk); + + Shared.Application.Activity.StartActivity(intent); + + } + else if (interphoneType == InterphoneType.EZVIZ.ToString()) + { + ((BaseActivity)Shared.Application.Activity).SetCamera(b => + { + if (b) + { + intent = new Android.Content.Intent(); + var bundle = new Android.OS.Bundle(); + //浼犻�抧ame鍙傛暟涓簍inyphp + bundle.PutString("EzChildAccessToken", mESVideoInfo.Lc_AccessToken); + bundle.PutString("HdlToken", UserInfo.Current.LoginTokenString); + bundle.PutString("Url", OnAppConfig.Instance.RequestHttpsHost); + bundle.PutString("EzvizAppKey", "1aa98a90489b4838b966b57018b4b04b"); + bundle.PutInt("Platform", 1); + bundle.PutString("HomeId", mESVideoInfo.HomeId); + bundle.PutString("DeviceSerial", mESVideoInfo.DeviceSerial); + intent.PutExtras(bundle); + intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity")); + Shared.Application.Activity.StartActivity(intent); + } + }); + return; + } + else if (interphoneType == InterphoneType.HDL.ToString()) + { + //HDL Linphone 鐙勮�愬厠 + + + } + else if (interphoneType == InterphoneType.FLVI.ToString()) + { + //寰呭垹鍑忎笉蹇呰鍙傛暟 + intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); + intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); + intent.PutExtra("uuid", mESVideoInfo.uuid); + intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); + intent.PutExtra("cmtID", mESVideoInfo.cmtID); + intent.PutExtra("roomno", mESVideoInfo.roomno); + intent.PutExtra("unitno", mESVideoInfo.unitno); + intent.PutExtra("HomeID", PirSend.HomeId); + intent.PutExtra("callId", mESVideoInfo.callId); + intent.PutExtra("Type", 1); + + //=========涔愭========== + intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken); + intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId); + intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("china") ? 0 : 1);//濡傛灉鍩熷悕鍖呭惈china锛屽垯鏄浗鍐呰处鍙�); + intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken); + intent.PutExtra("Psk", mESVideoInfo.Lc_Psk); + + + Shared.Application.Activity.StartActivity(intent); + } + else + { + HDLUtils.WriteLine("鏈敮鎸佺殑鍙瀵硅绫诲瀷"); + + } + + + + + + #endregion #endif } - #region 鍔ㄤ綔鍥炶皟锛屾彁浜よ褰曞埌浜戠 + #region 鍔ㄤ綔鍥炶皟鍜屽師鐢熶氦浜掞紝鎻愪氦璁板綍鍒颁簯绔� /// <summary> /// 鍒ゆ柇callId鏄惁涓虹┖ @@ -184,7 +387,7 @@ } else { - Utlis.WriteLine("POST 鎸傛柇澶辫触 code: "+ revertObj.Code); + Utlis.WriteLine("POST 鎸傛柇澶辫触 code: " + revertObj.Code); } }) @@ -258,6 +461,7 @@ } DateTime UnlockDateTime = DateTime.MinValue; + /// <summary> /// 寮�閿佹垚鍔� /// </summary> @@ -268,9 +472,9 @@ if (CheckESVideoInfoIsNullOrEmpty()) return; //3S鍐呬笉鍏佽瑙﹀彂绗簩娆� - if(UnlockDateTime.AddSeconds(3) > DateTime.Now) + if (UnlockDateTime.AddSeconds(3) > DateTime.Now) { - + Utlis.WriteLine("3S鍐呬笉鍏佽瑙﹀彂绗簩娆�"); //涓版灄SDKbug锛屽懠鍙殑鏃跺�欏紑閿佹垚鍔熶細鏈�2娆″洖璋冿紝 return; @@ -298,23 +502,100 @@ { IsBackground = false }.Start(); } -#endregion + #endregion + + #region 鐜嬭耽鏂版帴鍚拰寮�閿佹帴鍙� + /// <summary> + /// 寮�閿� + /// </summary> + void HDLUnlockAction() + { + //Utlis.WriteLine("UnlockAction"); + + if (esVideoInfo == null) return; + + new Thread(() => + { + Dictionary<string, object> dic = new Dictionary<string, object>(); + dic.Add("deviceId", esVideoInfo.Lc_DeviceId);//璁惧id + dic.Add("callId", esVideoInfo.callId); + var requestJson = HttpUtil.GetSignRequestJson(dic); + var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_OpenDoorbell, requestJson); + if (revertObj.Code == StateCode.SUCCESS) + { + Application.RunOnMainThread(() => + { +#if __IOS__ + //鍜屽師鐢熺洃鎺х晫闈氦浜掋�佸彂閫佸紑閿佹垚鍔熼�氱煡 + NSNotificationCenter.DefaultCenter.PostNotificationName("lcCallDelegateOpenDoorSuccess", null); +#endif + }); + } + else + { + Utlis.WriteLine("POST 寮�閿佸け璐� code: " + revertObj.Code); + } + + }) + { IsBackground = false }.Start(); + } + + /// <summary> + /// 鏇存敼閫氳瘽鐘舵�� + /// </summary> + void HDLUpdateCallStatus(CallStatusType callStatusType, InterphoneType interphoneType, int callDuration = 0) { + + if (CheckESVideoInfoIsNullOrEmpty()) return; + + new Thread(() => + { + Dictionary<string, object> dic = new Dictionary<string, object>(); + dic.Add("callId", esVideoInfo.callId);//鍛煎彨id + dic.Add("callStatus", callStatusType.ToString());//鍙敤鍊�:MISSED,RECEIVED,REJECT + dic.Add("interphoneTypeEnum", interphoneType.ToString());//鍙敤鍊�:FLVI,IMOUVISIAL + if (callStatusType == CallStatusType.RECEIVED && callDuration > 0) + { + dic.Add("callDuration", callDuration);//閫氳瘽鏃堕暱锛堢锛� + } + + var requestJson = HttpUtil.GetSignRequestJson(dic); + var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_UpdateCallStatus, requestJson); + if (revertObj.Code == StateCode.SUCCESS) + { + + } + else + { + Utlis.WriteLine("POST 鏇存柊鐘舵�佸け璐� code: " + revertObj.Code); + } + + }) + { IsBackground = false }.Start(); + + } + #endregion #if __IOS__ -#region OnESCallDelegate + #region OnESCallDelegate /////// <summary> /////// OnESCallDelegate 缁ф壙鍝嶅簲浜嬩欢 /////// </summary> OnESCallDelegate mOnESCallDelegate; /// <summary> - /// + /// iOS鍘熺敓濮旀墭浜嬩欢 /// </summary> public class OnESCallDelegate : ESCallDelegate { - + /// <summary> + /// ESOnVideo + /// </summary> [Weak] ESOnVideo _ESOnVideo; + /// <summary> + /// 鍒濆鍖� + /// </summary> + /// <param name="mESOnVideo">鍛煎彨鐩稿叧鐨勫弬鏁�</param> public OnESCallDelegate(ESOnVideo mESOnVideo) { _ESOnVideo = mESOnVideo; @@ -369,36 +650,108 @@ } -#endregion -#endif + #endregion + + #region OnLCCallDelegate + /////// <summary> + /////// OnLCCallDelegate 缁ф壙鍝嶅簲浜嬩欢 + /////// </summary> + OnLCCallDelegate mOnLCCallDelegate; /// <summary> - /// 娴嬭瘯鏂规硶 + /// /// </summary> - /// <param name="isMonitor"></param> - public void Test(bool isMonitor = true) + public class OnLCCallDelegate : LCCallDelegate { - ESVideoInfo eSVideoInfo = new ESVideoInfo() + + [Weak] ESOnVideo _ESOnVideo; + + public OnLCCallDelegate(ESOnVideo mESOnVideo) { - DeviceName = "瀹ゅ鏈�88", - ESVideoUUID = "JJY000019VPLLF", - - }; - if (isMonitor) - { - ShowESVideoMonitor(eSVideoInfo); + _ESOnVideo = mESOnVideo; } - else + + /// <summary> + /// 鎺ュ惉 + /// </summary> + public override void OnAnswerAction() { - eSVideoInfo.callId = "88888"; - ShowESvideoVideoIntercom(eSVideoInfo); + _ESOnVideo.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.IMOUVISIAL); + } + + /// <summary> + /// 鎸傛柇 + /// </summary> + /// <param name="callDuration"></param> + public override void OnHangUpAction(int callDuration) + { + _ESOnVideo.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.IMOUVISIAL, callDuration); + } + + /// <summary> + /// 鎷掓帴 + /// </summary> + public override void OnRejectCallAction() + { + _ESOnVideo.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.IMOUVISIAL); + } + + /// <summary> + /// 鎴浘鎴愬姛 + /// </summary> + /// <param name="image"></param> + public override void OnScreenshotSuccessfulAction(UIImage image) + { + ////NSData imageData = UIImagePNGRepresentation(image); UIImage + //NSData imageData = image.AsPNG(); + //byte[] dataBytes = new byte[imageData.Length]; + //System.Runtime.InteropServices.Marshal.Copy(imageData.Bytes, dataBytes, 0, Convert.ToInt32(imageData.Length)); + ////image.g + ////_ESOnVideo.ScreenshotSuccessfulAction(dataBytes); + } + + /// <summary> + /// 寮�閿佹垚鍔� + /// </summary> + public override void OnUnlockAction() + { + _ESOnVideo.HDLUnlockAction(); } } + + #endregion + + +#endif + + ///// <summary> + ///// 娴嬭瘯鏂规硶 + ///// </summary> + ///// <param name="isMonitor"></param> + //public void Test(bool isMonitor = true) + //{ + // ESVideoInfo eSVideoInfo = new ESVideoInfo() + // { + // DeviceName = "瀹ゅ鏈�88", + // ESVideoUUID = "JJY000019VPLLF", + + // }; + // if (isMonitor) + // { + // ShowESVideoMonitor(eSVideoInfo, ""); + // } + // else + // { + // eSVideoInfo.callId = "88888"; + // ShowESvideoVideoIntercom(eSVideoInfo, ""); + // } + + //} } /// <summary> - /// + /// 鍙瀵硅鍙傛暟瀵硅薄锛堜粎鍦ㄦ渶鍚庝竴姝ヨ烦杞埌activity鏃舵墠璋冪敤,涓轰簡鍋氬吋瀹硅繖閲岄兘鏁版嵁鏈夌偣涔憋紝浠ュ悗鏈夋椂闂村啀鐞嗛『鎬濊矾浼樺寲锛� /// </summary> public class ESVideoInfo { @@ -415,31 +768,114 @@ /// <summary> /// 涓版灄璇锋眰鐨勫敮涓�id /// </summary> - public string uuid; + public string uuid = string.Empty; /// <summary> /// 涓版灄绀惧尯id /// </summary> - public string cmtID; + public string cmtID = string.Empty; /// <summary> /// 涓版灄鎴块棿鍙� /// </summary> - public string roomno; + public string roomno = string.Empty; /// <summary> /// 涓版灄妤兼爧鍙� /// </summary> - public string unitno; + public string unitno = string.Empty; ///// <summary> ///// 涓版灄浣忓畢Id ///// </summary> - //public string HomeID; + //public string HomeID= string.Empty; /// <summary> /// 鍛煎彨璁板綍Id /// </summary> - public string callId; + public string callId = string.Empty; + + //========================澶у崕========================== + /// <summary> + /// 璐﹀彿accessToken + /// 钀ょ煶瀛愯处鍙稵oken涔熷叡鐢ㄨ繖涓瓧娈� + /// </summary> + public string Lc_AccessToken = string.Empty; + + /// <summary> + /// 璁惧搴忓垪鍙凤紝閫氳蹇呰瀛楁 + /// </summary> + public string Lc_DeviceId = string.Empty; + + /// <summary> + /// 澶囨敞锛燂紵锛� + /// </summary> + public string Lc_Psk = string.Empty; + + /// <summary> + /// 棰勮鐢婚潰蹇呴』浣跨敤 + /// </summary> + public string Lc_PlayToken = string.Empty; + + /// <summary> + /// 璐﹀彿鏍囪锛�0鍥藉唴锛�1鍥藉锛涘浗鍐呭浗澶栬闂兘鍦板潃涓嶄竴鏍� + /// </summary> + public int Lc_Location = 0; + + //========================钀ょ煶浜戠尗鐪�========================== + /// <summary> + /// 浣忓畢Id + /// </summary> + public string HomeId = string.Empty; + /// <summary> + /// 璁惧搴忓垪鍙� + /// </summary> + public string DeviceSerial = string.Empty; + //========================HDL SIP========================== + /// <summary> + /// 璁惧sip璐﹀彿 interphoneType鏄疕DL鏃舵墠浼氭湁鍊� + /// </summary> + public string deviceSipAccount; } - + + /// <summary> + /// 閫氳瘽鐘舵�佺被鍨� + /// </summary> + public enum CallStatusType + { + /// <summary> + /// 鏈帴 + /// </summary> + MISSED, + /// <summary> + /// 宸叉帴鍚� + /// </summary> + RECEIVED, + /// <summary> + /// 鎷掓帴 + /// </summary> + REJECT, + } + + /// <summary> + /// 鍙瀵硅璁惧骞冲彴绫诲瀷 + /// </summary> + public enum InterphoneType + { + /// <summary> + /// 涓版灄骞冲彴 + /// </summary> + FLVI, + /// <summary> + /// 澶у崕鍙瀵硅骞冲彴 + /// </summary> + IMOUVISIAL, + /// <summary> + /// 钀ょ煶鐚溂鍛煎彨 + /// </summary> + EZVIZ, + /// <summary> + /// 鐙勮�愬厠 HDL Linphone + /// </summary> + HDL, + } } -- Gitblit v1.8.0