From 976c5f3b22372ad415f2662f7341aee25652f7c3 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 13 七月 2021 13:55:42 +0800
Subject: [PATCH] 萤石以dll方式引用
---
HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs | 122 +++++++++++++++++++++++++++++++---------
1 files changed, 93 insertions(+), 29 deletions(-)
diff --git a/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs b/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
index 5122a1e..aa8353d 100644
--- a/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
+++ b/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
@@ -4,6 +4,7 @@
using System.Threading;
using System.Collections.Generic;
using HDL_ON.UI.UI2.PersonalCenter.PirDevice;
+using HDL_ON.Entity;
#if __IOS__
using Shared.IOS.ESVideoOnSDK;
@@ -48,7 +49,7 @@
public ESVideoInfo esVideoInfo;
/// <summary>
- ///
+ /// 鏆傛椂娌$敤
/// </summary>
public void InitESVideoSDK()
{
@@ -66,7 +67,7 @@
int.TryParse(mESVideoInfo.roomno, out roomID);
#if __IOS__
- if (interphoneType == "IMOUVISIAL")
+ if (interphoneType == InterphoneType.IMOUVISIAL.ToString())
{
//涔愭鍙瀵硅
//1.鍒濆鍖朙COpenSDK_Api
@@ -95,7 +96,7 @@
}
#else
Intent intent = null;
- if (interphoneType == "IMOUVISIAL")
+ if (interphoneType == InterphoneType.IMOUVISIAL.ToString())
{
intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.LeChengVideoActivity));
}
@@ -136,7 +137,7 @@
int roomID = 0;
int.TryParse(mESVideoInfo.roomno, out roomID);
#if __IOS__
- if (interphoneType == "IMOUVISIAL")
+ if (interphoneType == InterphoneType.IMOUVISIAL.ToString())
{
//涔愭鍙瀵硅
//1.鍒濆鍖朙COpenSDK_Api
@@ -152,6 +153,21 @@
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.InitLibWithAppKey("1aa98a90489b4838b966b57018b4b04b", "1aa98a90489b4838b966b57018b4b04b");
+ //1.璁剧疆鎵�闇�娌充笢鐨凙ccessToken鍜孯efreshToken銆佸煙鍚嶅湴鍧�
+ EZSDK.IOS.EZSDK.SetHDlAccessToken(UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken);
+
+ EZSDK.IOS.EZSDK.SetRequestHttpsHostAndPlatform(OnAppConfig.Instance.RequestHttpsHost, 1, mESVideoInfo.HomeId);
+ //2.璁剧疆钀ょ煶瀛愯处鍙风殑AccessToken鍒癝DK
+ EZSDK.IOS.EZSDK.SetEZAccessToken(mESVideoInfo.Lc_AccessToken);
+ //3.鎵撳紑瑙嗛鎾斁椤甸潰
+ EZSDK.IOS.EZSDK.PlayWithDeviceSerial(mESVideoInfo.DeviceSerial);
+
}
else
{
@@ -170,9 +186,32 @@
#region
Intent intent = null;
- if (interphoneType == "IMOUVISIAL")
+ if (interphoneType == InterphoneType.IMOUVISIAL.ToString())
{
intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.LeChengVideoActivity));
+ }
+ 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
{
@@ -460,13 +499,19 @@
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;
@@ -592,31 +637,33 @@
}
#endregion
+
+
#endif
- /// <summary>
- /// 娴嬭瘯鏂规硶
- /// </summary>
- /// <param name="isMonitor"></param>
- public void Test(bool isMonitor = true)
- {
- ESVideoInfo eSVideoInfo = new ESVideoInfo()
- {
- DeviceName = "瀹ゅ鏈�88",
- ESVideoUUID = "JJY000019VPLLF",
+ ///// <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, "");
- }
+ // };
+ // if (isMonitor)
+ // {
+ // ShowESVideoMonitor(eSVideoInfo, "");
+ // }
+ // else
+ // {
+ // eSVideoInfo.callId = "88888";
+ // ShowESvideoVideoIntercom(eSVideoInfo, "");
+ // }
- }
+ //}
}
/// <summary>
@@ -661,9 +708,9 @@
//========================澶у崕==========================
-
/// <summary>
/// 璐﹀彿accessToken
+ /// 钀ょ煶瀛愯处鍙稵oken涔熷叡鐢ㄨ繖涓瓧娈�
/// </summary>
public string Lc_AccessToken = string.Empty;
@@ -686,6 +733,17 @@
/// 璐﹀彿鏍囪锛�0鍥藉唴锛�1鍥藉锛涘浗鍐呭浗澶栬闂兘鍦板潃涓嶄竴鏍�
/// </summary>
public int Lc_Location = 0;
+
+ //========================钀ょ煶浜戠尗鐪�==========================
+ /// <summary>
+ /// 浣忓畢Id
+ /// </summary>
+ public string HomeId = string.Empty;
+ /// <summary>
+ /// 璁惧搴忓垪鍙�
+ /// </summary>
+ public string DeviceSerial = string.Empty;
+
}
@@ -722,5 +780,11 @@
/// 澶у崕鍙瀵硅骞冲彴
/// </summary>
IMOUVISIAL,
+ /// <summary>
+ /// 钀ょ煶鐚溂鍛煎彨
+ /// </summary>
+ EZVIZ,
+
+
}
}
--
Gitblit v1.8.0