JLChen
2021-03-26 9c33e4ccb90fae87a614abd2ed1ab034d3b7a13d
HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
File was renamed from HDL_ON/DAL/FL/ESOnVideo.cs
@@ -8,6 +8,9 @@
using Shared.IOS.ESVideoOnSDK;
using UIKit;
using Foundation;
#else
using Android.Content;
#endif
@@ -68,6 +71,17 @@
            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
        }
@@ -93,6 +107,17 @@
            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
        }
@@ -105,13 +130,7 @@
        /// <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>
@@ -119,7 +138,7 @@
        /// </summary>
        void AnswerAction()
        {
            Utlis.WriteLine("AnswerAction");
            //Utlis.WriteLine("AnswerAction");
            if (CheckESVideoInfoIsNullOrEmpty()) return;
@@ -129,7 +148,7 @@
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Answer, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
                {
                    Utlis.WriteLine("POST 接听成功");
                    //Utlis.WriteLine("POST 接听成功");
                }
                else
                {
@@ -147,7 +166,7 @@
        /// <param name="callDuration"></param>
        void HangUpAction(int callDuration)
        {
            Utlis.WriteLine("HangUpAction :" + callDuration);
            //Utlis.WriteLine("HangUpAction :" + callDuration);
            if (CheckESVideoInfoIsNullOrEmpty()) return;
@@ -161,7 +180,7 @@
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_HangUp, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
                {
                    Utlis.WriteLine("POST 挂断成功");
                    //Utlis.WriteLine("POST 挂断成功");
                }
                else
                {
@@ -177,7 +196,7 @@
        /// </summary>
        void RejectCallAction()
        {
            Utlis.WriteLine("RejectCallAction");
            //Utlis.WriteLine("RejectCallAction");
            if (CheckESVideoInfoIsNullOrEmpty()) return;
@@ -190,7 +209,7 @@
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Reject, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
                {
                    Utlis.WriteLine("POST 拒接成功");
                    //Utlis.WriteLine("POST 拒接成功");
                }
                else
                {
@@ -206,23 +225,27 @@
        /// </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
                {
@@ -240,18 +263,20 @@
        /// </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(() =>
            {
@@ -262,7 +287,7 @@
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Unlock, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
                {
                    Utlis.WriteLine("POST 开锁成功");
                    //Utlis.WriteLine("POST 开锁成功");
                }
                else
                {
@@ -273,10 +298,10 @@
            { IsBackground = false }.Start();
        }
        #endregion
#endregion
#if __IOS__
        #region OnESCallDelegate
#region OnESCallDelegate
        /////// <summary>
        /////// OnESCallDelegate 继承响应事件
        /////// </summary>
@@ -344,7 +369,7 @@
        }
        #endregion
#endregion
#endif
        /// <summary>
@@ -386,7 +411,7 @@
        /// 室外机的名称
        /// 例:室外机
        /// </summary>
        public string DeviceName = "门口机";
        public string DeviceName = "室外机";
        /// <summary>
        /// 丰林请求的唯一id
        /// </summary>