From 9c33e4ccb90fae87a614abd2ed1ab034d3b7a13d Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 26 三月 2021 11:26:01 +0800
Subject: [PATCH] 2021-03-26 1.对接接口优化。

---
 HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs |   73 ++++++++++++++++++++++++------------
 1 files changed, 49 insertions(+), 24 deletions(-)

diff --git a/HDL_ON/DAL/FL/ESOnVideo.cs b/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
similarity index 81%
rename from HDL_ON/DAL/FL/ESOnVideo.cs
rename to HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
index e9a5cf2..6b310f0 100644
--- a/HDL_ON/DAL/FL/ESOnVideo.cs
+++ b/HDL_ON/DAL/ThirdPartySdk/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>

--
Gitblit v1.8.0