JLChen
2021-07-08 35a1f11de802c78b89460c696ffbe8b1c8346a39
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.初始化LCOpenSDK_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,12 +137,13 @@
            int roomID = 0;
            int.TryParse(mESVideoInfo.roomno, out roomID);
#if __IOS__
            if (interphoneType == "IMOUVISIAL")
            if (interphoneType == InterphoneType.IMOUVISIAL.ToString())
            {
                //乐橙可视对讲
                //1.初始化LCOpenSDK_Api
                LCApiKit.SharedInstance().InitSDKOpenApi(mESVideoInfo.Lc_AccessToken);
                LCApiKit.SharedInstance().CurrentDevicePlayToken = mESVideoInfo.Lc_PlayToken;
                //2021-05-18 目前推送的PlayToken;有问题会导致SDK崩溃,暂时不传
                //LCApiKit.SharedInstance().CurrentDevicePlayToken = mESVideoInfo.Lc_PlayToken;
                LCApiKit.SharedInstance().CurrentDeviceId = mESVideoInfo.Lc_DeviceId;
                LCApiKit.SharedInstance().CurrentDeviceName = mESVideoInfo.DeviceName;
                LCApiKit.SharedInstance().CurrentPsk = mESVideoInfo.Lc_DeviceId;
@@ -151,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,中文国内key、英文海外key 开发者账号使用应用包名申请的APPKEY,不同包名应用需配置不同的APPKEY
                EZSDK.IOS.EZSDK.InitLibWithAppKey("1aa98a90489b4838b966b57018b4b04b", "1aa98a90489b4838b966b57018b4b04b");
                //1.设置所需河东的AccessToken和RefreshToken、域名地址
                EZSDK.IOS.EZSDK.SetHDlAccessToken(UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken);
                EZSDK.IOS.EZSDK.SetRequestHttpsHostAndPlatform(OnAppConfig.Instance.RequestHttpsHost, 1, mESVideoInfo.HomeId);
                //2.设置萤石子账号的AccessToken到SDK
                EZSDK.IOS.EZSDK.SetEZAccessToken(mESVideoInfo.Lc_AccessToken);
                //3.打开视频播放页面
                EZSDK.IOS.EZSDK.PlayWithDeviceSerial(mESVideoInfo.DeviceSerial);
            }
            else
            {
@@ -169,9 +186,12 @@
            #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())
            {
                //萤石猫眼呼叫处理
            }
            else
            {
@@ -394,6 +414,7 @@
            {
                Dictionary<string, object> dic = new Dictionary<string, object>();
                dic.Add("deviceId", esVideoInfo.Lc_DeviceId);//设备id
                dic.Add("callId", esVideoInfo.callId);
                var requestJson = HttpUtil.GetSignRequestJson(dic);
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_OpenDoorbell, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
@@ -458,13 +479,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;
@@ -590,31 +617,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>
@@ -659,9 +688,9 @@
        //========================大华==========================
        /// <summary>
        /// 账号accessToken
        /// 萤石子账号Token也共用这个字段
        /// </summary>
        public string Lc_AccessToken = string.Empty;
@@ -684,6 +713,17 @@
        /// 账号标记:0国内,1国外;国内国外访问都地址不一样
        /// </summary>
        public int Lc_Location = 0;
        //========================萤石云猫眼==========================
        /// <summary>
        /// 住宅Id
        /// </summary>
        public string HomeId = string.Empty;
        /// <summary>
        /// 设备序列号
        /// </summary>
        public string DeviceSerial = string.Empty;
    }
@@ -720,5 +760,11 @@
        /// 大华可视对讲平台
        /// </summary>
        IMOUVISIAL,
        /// <summary>
        /// 萤石猫眼呼叫
        /// </summary>
        EZVIZ,
    }
}