From 42fad29b1e280b512452f5552d1e9ce98474252e Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 17 五月 2021 09:40:14 +0800
Subject: [PATCH] 2021-05-17 1.在阿廖分支基础上增加iOS乐橙可视对讲功能,目前呼叫还有一点问题,偶尔会闪退,目前还没定位到原因

---
 HDL_APP_Project.sln                                     |   14 ++
 HDL_ON/DAL/Server/NewAPI.cs                             |    9 +
 HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs |    6 
 HDL_ON/Common/HDLCommon.cs                              |    3 
 HDL-ON_iOS/HDL-ON_iOS.csproj                            |    9 
 HDL_ON/UI/UI2/UserPageBLL.cs                            |    2 
 .vs/HDL_APP_Project/xs/UserPrefs.xml                    |   64 +++++++-
 DLL/LC/IOS/Shared.IOS.LCVideoOnSDK.dll                  |    0 
 HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs                   |  257 +++++++++++++++++++++++++++++++++--
 9 files changed, 325 insertions(+), 39 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index a26b12d..7103055 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,18 +1,56 @@
-锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
-  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.26569F89-0BA9-4C06-81F2-764A3AF2E1B7" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="HDL-ON_Android/LeChengVideoActivity.cs">
+锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
+  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" />
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs">
     <Files>
-      <File FileName="HDL-ON_Android/Resources/values/strings.xml" Line="21" Column="1" />
-      <File FileName="HDL-ON_Android/Resources/values-zh/strings.xml" Line="21" Column="39" />
-      <File FileName="HDL-ON_Android/LeChengVideoActivity.cs" Line="1" Column="1" />
+      <File FileName="HDL_ON/Common/HDLCommon.cs" Line="318" Column="1" />
+      <File FileName="HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs" Line="62" Column="27" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="1" Column="1" />
+      <File FileName="../../../../../../Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/ObjCRuntime/Runtime.cs" Line="407" Column="1" />
+      <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="220" Column="68" />
+      <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="114" Column="39" />
+      <File FileName="HDL_ON/DAL/Server/NewAPI.cs" Line="585" Column="53" />
+      <File FileName="HDL_ON/DAL/Server/NewApiRes.cs" Line="77" Column="33" />
+      <File FileName="HDL_ON/Common/Constant.cs" Line="270" Column="23" />
+      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs" Line="14" Column="21" />
+      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs" Line="30" Column="47" />
+      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs" Line="74" Column="39" />
+      <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="296" Column="128" />
+      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs" Line="129" Column="38" />
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
         <State name="__root__">
           <Node name="HDL_APP_Project" expanded="True">
+            <Node name="HDL_ON" expanded="True">
+              <Node name="Common" expanded="True" />
+              <Node name="DAL" expanded="True">
+                <Node name="Server" expanded="True" />
+                <Node name="ThirdPartySdk" expanded="True" />
+              </Node>
+              <Node name="UI" expanded="True">
+                <Node name="UI2" expanded="True">
+                  <Node name="4-PersonalCenter" expanded="True">
+                    <Node name="PirDevice" expanded="True" />
+                  </Node>
+                  <Node name="FuntionControlView" expanded="True">
+                    <Node name="Video" expanded="True">
+                      <Node name="ObjectClass.cs" selected="True" />
+                    </Node>
+                  </Node>
+                </Node>
+              </Node>
+            </Node>
             <Node name="HDL-ON_Android" expanded="True">
-              <Node name="LeChengVideo" expanded="True" />
-              <Node name="LeChengVideoActivity.cs" selected="True" />
+              <Node name="LeChengVideo" expanded="True">
+                <Node name="Form" expanded="True" />
+              </Node>
+            </Node>
+            <Node name="HDL-ON_iOS" expanded="True">
+              <Node name="Other" expanded="True" />
+              <Node name="Resources" expanded="True" />
+            </Node>
+            <Node name="Shared.IOS.LCVideoOnSDK" expanded="True">
+              <Node name="NativeReferenceFolder" expanded="True" />
             </Node>
           </Node>
         </State>
@@ -26,11 +64,15 @@
     <String>Shared.IOS/Shared.IOS.csproj</String>
   </DisabledProjects>
   <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
-  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.2ffc9a07" />
+  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.Android_Accelerated_Oreo" />
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
     <BreakpointStore>
-      <Breakpoint file="/Users/liaoshaosheng/Documents/GitHub/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" line="34" column="1" />
-      <Breakpoint file="/Users/liaoshaosheng/Documents/GitHub/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" line="313" column="1" />
+      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" line="34" column="1" />
+      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" line="313" column="1" />
+      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs" relfile="HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs" line="83" column="1" />
+      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/Common/HDLCommon.cs" relfile="HDL_ON/Common/HDLCommon.cs" line="318" column="1" />
+      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs" line="31" column="1" />
+      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs" line="180" column="1" />
     </BreakpointStore>
   </MonoDevelop.Ide.DebuggingService.Breakpoints>
   <MultiItemStartupConfigurations />
diff --git a/DLL/LC/IOS/Shared.IOS.LCVideoOnSDK.dll b/DLL/LC/IOS/Shared.IOS.LCVideoOnSDK.dll
new file mode 100644
index 0000000..78a7649
--- /dev/null
+++ b/DLL/LC/IOS/Shared.IOS.LCVideoOnSDK.dll
Binary files differ
diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj
index b18bd6a..71ba93e 100644
--- a/HDL-ON_iOS/HDL-ON_iOS.csproj
+++ b/HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -91,12 +91,15 @@
         <Reference Include="EZSDK.IOS">
           <HintPath>..\DLL\IOS\EZSDK.IOS.dll</HintPath>
         </Reference>
-        <Reference Include="Shared.IOS.ESVideoOnSDK">
-          <HintPath>..\DLL\FL\iOS\Shared.IOS.ESVideoOnSDK.dll</HintPath>
-        </Reference>
         <Reference Include="Shared.IOS">
           <HintPath>..\DLL\Shared.IOS.dll</HintPath>
         </Reference>
+        <Reference Include="Shared.IOS.LCVideoOnSDK">
+          <HintPath>..\..\LCOpenSDK_iOS\iOS\Xamarin\Shared.IOS.LCVideoOnSDK\Shared.IOS.LCVideoOnSDK\bin\Release\Shared.IOS.LCVideoOnSDK.dll</HintPath>
+        </Reference>
+        <Reference Include="Shared.IOS.ESVideoOnSDK">
+          <HintPath>..\DLL\FL\iOS\Shared.IOS.ESVideoOnSDK.dll</HintPath>
+        </Reference>
     </ItemGroup>
     <ItemGroup>
       <PackageReference Include="Newtonsoft.Json">
diff --git a/HDL_APP_Project.sln b/HDL_APP_Project.sln
index 6e5610f..2c65910 100644
--- a/HDL_APP_Project.sln
+++ b/HDL_APP_Project.sln
@@ -9,6 +9,8 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blufi", "HdlBluWi\Blufi.csproj", "{2DDF4C3C-6998-432E-9F43-6786D82F0630}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared.IOS.LCVideoOnSDK", "..\LCOpenSDK_iOS\iOS\Xamarin\Shared.IOS.LCVideoOnSDK\Shared.IOS.LCVideoOnSDK\Shared.IOS.LCVideoOnSDK.csproj", "{D78A9ED7-34A3-416F-B645-7475E2E2DE93}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -55,5 +57,17 @@
 		{2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|iPhone.Build.0 = Debug|Any CPU
 		{2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhone.ActiveCfg = Release|Any CPU
 		{2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhone.Build.0 = Release|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Debug|iPhone.Build.0 = Debug|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Release|iPhone.ActiveCfg = Release|Any CPU
+		{D78A9ED7-34A3-416F-B645-7475E2E2DE93}.Release|iPhone.Build.0 = Release|Any CPU
 	EndGlobalSection
 EndGlobal
diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index 93b28ca..266b24f 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -306,7 +306,8 @@
                         var json= Newtonsoft.Json.Linq.JObject.Parse(jpushMessageInfo.expantContent);
                         ESVideoInfo eSVideoInfo = new ESVideoInfo();// GetESOnVideoJson(jpushMessageInfo.expantContent);
                         eSVideoInfo.callId = json["callId"].ToString();
-                        eSVideoInfo.Lc_AccessToken =  UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken;//json["subAccountToken"].ToString();//
+                        //eSVideoInfo.Lc_AccessToken = UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken;//json["subAccountToken"].ToString();//
+                        eSVideoInfo.Lc_AccessToken = json["subAccountToken"].ToString();//2021-05-13 鐩墠浜戠杩樻病鎷垮埌Lc_AccessToken锛岀洰鍓嶆病鍔炴硶姝e父浣跨敤
                         eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString();
                         eSVideoInfo.Lc_Location = OnAppConfig.Instance.RequestHttpsHost.Contains("China") ? 0 : 1;
                         eSVideoInfo.Lc_PlayToken = json["token"].ToString();
diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs
index 1a9be9f..51305f0 100644
--- a/HDL_ON/DAL/Server/NewAPI.cs
+++ b/HDL_ON/DAL/Server/NewAPI.cs
@@ -583,8 +583,17 @@
         /// 鑾峰彇鍙瀵硅璁惧鍒楄〃锛堟墍鏈夊鎺ュ彲瑙嗗璁查兘鍖呭惈涓�璧凤級
         /// </summary>
         public const string API_POST_VideoDeviceList = "/home-wisdom/platform/imou/listVisualSpeaks";
+        /// <summary>
+        /// 杩滅▼寮�闂�
+        /// </summary>
+        public const string API_POST_VideoDevice_OpenDoorbell = "/home-wisdom/platform/imou/openDoorbell";
+        /// <summary>
+        /// 鏇存敼閫氳瘽鐘舵��
+        /// </summary>
+        public const string API_POST_VideoDevice_UpdateCallStatus = "/home-wisdom/platform/imou/updateCallStatus";
         #endregion
 
+
     }
 
     ///// <summary>
diff --git a/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs b/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
index c0b6dcd..812f119 100644
--- a/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
+++ b/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
@@ -7,6 +7,7 @@
 
 #if __IOS__
 using Shared.IOS.ESVideoOnSDK;
+using Shared.IOS.LCVideoOnSDK;
 using UIKit;
 using Foundation;
 #else
@@ -60,16 +61,38 @@
         /// <param name="mESVideoInfo"></param>
         public void ShowESVideoMonitor(ESVideoInfo mESVideoInfo, string interphoneType)
         {
-#if __IOS__
-             int roomID = 0;
+            this.esVideoInfo = mESVideoInfo;
+            int roomID = 0;
             int.TryParse(mESVideoInfo.roomno, out roomID);
-            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);
+
+#if __IOS__
+            if (interphoneType == "IMOUVISIAL")
+            {
+                //涔愭鍙瀵硅
+                //1.鍒濆鍖朙COpenSDK_Api
+                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
+            {
+
+                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
             Intent intent = null;
             if (interphoneType == "IMOUVISIAL")
@@ -110,18 +133,38 @@
         public void ShowESvideoVideoIntercom(ESVideoInfo mESVideoInfo, string interphoneType)
         {
             this.esVideoInfo = mESVideoInfo;
-#if __IOS__
             int roomID = 0;
             int.TryParse(mESVideoInfo.roomno, out roomID);
-            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);
+#if __IOS__
+            if (interphoneType == "IMOUVISIAL")
+            {
+                //涔愭鍙瀵硅
+                //1.鍒濆鍖朙COpenSDK_Api
+                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.璺宠浆涔愭鍛煎彨椤甸潰
+                LCOnIntercomViewController vc = new LCOnIntercomViewController();
+                mOnLCCallDelegate = new OnLCCallDelegate(this);
+                vc.MLCCallDelegate = mOnLCCallDelegate;
+                //vc.MLCCallDelegate = new OnLCCallDelegate(this);
+                Shared.Application.currentVC.NavigationController.PushViewController(vc, true);
+            }
+            else
+            {
+
+                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
             #region
 
@@ -158,7 +201,7 @@
 #endif
         }
 
-        #region 鍔ㄤ綔鍥炶皟锛屾彁浜よ褰曞埌浜戠
+        #region 鍔ㄤ綔鍥炶皟鍜屽師鐢熶氦浜掞紝鎻愪氦璁板綍鍒颁簯绔�
 
         /// <summary>
         /// 鍒ゆ柇callId鏄惁涓虹┖
@@ -337,6 +380,76 @@
 
         #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
+                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
         /////// <summary>
@@ -402,6 +515,76 @@
             public override void OnUnlockAction()
             {
                 _ESOnVideo.UnlockAction();
+            }
+
+        }
+
+        #endregion
+
+        #region OnLCCallDelegate
+        /////// <summary>
+        /////// OnLCCallDelegate 缁ф壙鍝嶅簲浜嬩欢
+        /////// </summary>
+        OnLCCallDelegate mOnLCCallDelegate;
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public class OnLCCallDelegate : LCCallDelegate
+        {
+
+            [Weak] ESOnVideo _ESOnVideo;
+
+            public OnLCCallDelegate(ESOnVideo mESOnVideo)
+            {
+                _ESOnVideo = mESOnVideo;
+            }
+
+            /// <summary>
+            /// 鎺ュ惉
+            /// </summary>
+            public override void OnAnswerAction()
+            {
+                _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();
             }
 
         }
@@ -504,4 +687,38 @@
 
     }
 
+
+    /// <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,
+    }
 }
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
index f5ca90f..d983758 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
@@ -265,11 +265,11 @@
                 //闂ㄥ彛鏈虹殑鐐瑰嚮浜嬩欢
                 clickBtn.MouseUpEventHandler += (sender, e) =>
                 {
-                    var video = clickBtn.Tag as Video;
-                    if (video.devType == "100")
+                    var video2 = clickBtn.Tag as Video;
+                    if (video2.devType == "100")
                     {
                         //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�
-                        VideoSend.GetQRcode(this, video, (tag, paw) =>
+                        VideoSend.GetQRcode(this, video2, (tag, paw) =>
                         {
                             if (tag)
                             {
diff --git a/HDL_ON/UI/UI2/UserPageBLL.cs b/HDL_ON/UI/UI2/UserPageBLL.cs
index eade440..b7c69dd 100644
--- a/HDL_ON/UI/UI2/UserPageBLL.cs
+++ b/HDL_ON/UI/UI2/UserPageBLL.cs
@@ -1,5 +1,5 @@
 锘縰sing System;
-using Android.Content;
+//using Android.Content;
 using Shared;
 
 namespace HDL_ON.UI

--
Gitblit v1.8.0