JLChen
2021-08-21 af9c3e0b3b1eb370e966b3ca9db3f62848d4189b
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;
@@ -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,7 +137,7 @@
            int roomID = 0;
            int.TryParse(mESVideoInfo.roomno, out roomID);
#if __IOS__
            if (interphoneType == "IMOUVISIAL")
            if (interphoneType == InterphoneType.IMOUVISIAL.ToString())
            {
                //乐橙可视对讲
                //1.初始化LCOpenSDK_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,中文国内key、英文海外key 开发者账号使用应用包名申请的APPKEY,不同包名应用需配置不同的APPKEY
                EZSDK.IOS.EZSDK.SharedInstance().InitLibWithAppKey("1aa98a90489b4838b966b57018b4b04b", "1aa98a90489b4838b966b57018b4b04b");
                //1.设置所需河东的AccessToken和RefreshToken、域名地址
                EZSDK.IOS.EZSDK.SharedInstance().SetHDlAccessToken(UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken);
                EZSDK.IOS.EZSDK.SharedInstance().SetRequestHttpsHostAndPlatform(OnAppConfig.Instance.RequestHttpsHost, 1, mESVideoInfo.HomeId);
                //2.设置萤石子账号的AccessToken到SDK
                EZSDK.IOS.EZSDK.SharedInstance().SetEZAccessToken(mESVideoInfo.Lc_AccessToken);
                //3.打开视频播放页面
                EZSDK.IOS.EZSDK.SharedInstance().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();
                        //传递name参数为tinyphp
                        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
            {
@@ -598,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>
@@ -667,9 +708,9 @@
        //========================大华==========================
        /// <summary>
        /// 账号accessToken
        /// 萤石子账号Token也共用这个字段
        /// </summary>
        public string Lc_AccessToken = string.Empty;
@@ -692,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;
    }
@@ -728,5 +780,11 @@
        /// 大华可视对讲平台
        /// </summary>
        IMOUVISIAL,
        /// <summary>
        /// 萤石猫眼呼叫
        /// </summary>
        EZVIZ,
    }
}