File was renamed from HDL_ON/DAL/FL/ESOnVideo.cs |
| | |
| | | using Shared.IOS.ESVideoOnSDK; |
| | | using UIKit; |
| | | using Foundation; |
| | | #else |
| | | |
| | | using Android.Content; |
| | | |
| | | #endif |
| | | |
| | |
| | | Shared.Application.currentVC.NavigationController.PushViewController(vc, true); |
| | | #else |
| | | |
| | | 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); |
| | | |
| | | #endif |
| | | } |
| | |
| | | Shared.Application.currentVC.NavigationController.PushViewController(vc, true); |
| | | #else |
| | | |
| | | 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); |
| | | |
| | | #endif |
| | | } |
| | |
| | | /// <returns></returns> |
| | | bool CheckESVideoInfoIsNullOrEmpty() |
| | | { |
| | | if(esVideoInfo == null || string.IsNullOrEmpty(esVideoInfo.callId)) |
| | | { |
| | | Utlis.WriteLine("ESVideoInfo Is NullOrEmpty"); |
| | | return true; |
| | | } |
| | | return false; |
| | | //return (esVideoInfo == null || string.IsNullOrEmpty(esVideoInfo.callId)); |
| | | return (esVideoInfo == null || string.IsNullOrEmpty(esVideoInfo.callId)); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | void AnswerAction() |
| | | { |
| | | Utlis.WriteLine("AnswerAction"); |
| | | //Utlis.WriteLine("AnswerAction"); |
| | | |
| | | if (CheckESVideoInfoIsNullOrEmpty()) return; |
| | | |
| | |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Answer, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | Utlis.WriteLine("POST 接听成功"); |
| | | //Utlis.WriteLine("POST 接听成功"); |
| | | } |
| | | else |
| | | { |
| | |
| | | /// <param name="callDuration"></param> |
| | | void HangUpAction(int callDuration) |
| | | { |
| | | Utlis.WriteLine("HangUpAction :" + callDuration); |
| | | //Utlis.WriteLine("HangUpAction :" + callDuration); |
| | | |
| | | if (CheckESVideoInfoIsNullOrEmpty()) return; |
| | | |
| | |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_HangUp, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | Utlis.WriteLine("POST 挂断成功"); |
| | | //Utlis.WriteLine("POST 挂断成功"); |
| | | } |
| | | else |
| | | { |
| | |
| | | /// </summary> |
| | | void RejectCallAction() |
| | | { |
| | | Utlis.WriteLine("RejectCallAction"); |
| | | //Utlis.WriteLine("RejectCallAction"); |
| | | |
| | | if (CheckESVideoInfoIsNullOrEmpty()) return; |
| | | |
| | |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Reject, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | Utlis.WriteLine("POST 拒接成功"); |
| | | //Utlis.WriteLine("POST 拒接成功"); |
| | | } |
| | | else |
| | | { |
| | |
| | | /// </summary> |
| | | void ScreenshotSuccessfulAction(byte[] dataBytes) |
| | | { |
| | | Utlis.WriteLine("ScreenshotSuccessfulAction"); |
| | | //Utlis.WriteLine("ScreenshotSuccessfulAction"); |
| | | |
| | | if (CheckESVideoInfoIsNullOrEmpty()) return; |
| | | |
| | | new Thread(() => |
| | | { |
| | | var imageName = Guid.NewGuid().ToString(); |
| | | //var imageName = Guid.NewGuid().ToString(); |
| | | Dictionary<string, object> dic = new Dictionary<string, object>(); |
| | | dic.Add("callId", esVideoInfo.callId); |
| | | dic.Add("images", dataBytes); |
| | | dic.Add("imagesName", "FL" + imageName + "_ios.jpg"); |
| | | #if __IOS__ |
| | | dic.Add("imagesName", "_IOS.jpg"); |
| | | #else |
| | | dic.Add("imagesName", "_Android.jpg"); |
| | | #endif |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(dic); |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Screenshot, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | Utlis.WriteLine("POST 截图上传成功"); |
| | | //Utlis.WriteLine("POST 截图上传成功"); |
| | | } |
| | | else |
| | | { |
| | |
| | | /// </summary> |
| | | void UnlockAction() |
| | | { |
| | | Utlis.WriteLine("UnlockAction"); |
| | | //Utlis.WriteLine("UnlockAction"); |
| | | |
| | | if (CheckESVideoInfoIsNullOrEmpty()) return; |
| | | |
| | | //3S内不允许触发第二次 |
| | | if(UnlockDateTime.AddSeconds(3) > DateTime.Now) |
| | | { |
| | | UnlockDateTime = DateTime.Now; |
| | | |
| | | Utlis.WriteLine("3S内不允许触发第二次"); |
| | | //丰林SDKbug,呼叫的时候开锁成功会有2次回调, |
| | | return; |
| | | } |
| | | |
| | | UnlockDateTime = DateTime.Now; |
| | | |
| | | new Thread(() => |
| | | { |
| | |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Unlock, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | Utlis.WriteLine("POST 开锁成功"); |
| | | //Utlis.WriteLine("POST 开锁成功"); |
| | | } |
| | | else |
| | | { |
| | |
| | | { IsBackground = false }.Start(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #if __IOS__ |
| | | #region OnESCallDelegate |
| | | #region OnESCallDelegate |
| | | /////// <summary> |
| | | /////// OnESCallDelegate 继承响应事件 |
| | | /////// </summary> |
| | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | #endif |
| | | |
| | | /// <summary> |
| | |
| | | /// 室外机的名称 |
| | | /// 例:室外机 |
| | | /// </summary> |
| | | public string DeviceName = "门口机"; |
| | | public string DeviceName = "室外机"; |
| | | /// <summary> |
| | | /// 丰林请求的唯一id |
| | | /// </summary> |