lss
2021-04-23 8ccc71771efec9434ad3b4a45c5f2ec11326d40f
HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
@@ -3,6 +3,7 @@
using HDL_ON.DAL.Server;
using System.Threading;
using System.Collections.Generic;
using HDL_ON.UI.UI2.PersonalCenter.PirDevice;
#if __IOS__
using Shared.IOS.ESVideoOnSDK;
@@ -57,7 +58,7 @@
        /// 监控页面
        /// </summary>
        /// <param name="mESVideoInfo"></param>
        public void ShowESVideoMonitor(ESVideoInfo mESVideoInfo)
        public void ShowESVideoMonitor(ESVideoInfo mESVideoInfo, string interphoneType)
        {
#if __IOS__
             int roomID = 0;
@@ -70,29 +71,43 @@
            vc.MESCallDelegate = new OnESCallDelegate(this);
            Shared.Application.currentVC.NavigationController.PushViewController(vc, true);
#else
            Intent intent = null;
            if (interphoneType == "IMOUVISIAL")
            {
                intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.LeChengVideoActivity));
            }
            else
            {
                intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity));
            }
            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("HomeID", PirSend.HomeId);
            intent.PutExtra("callId", mESVideoInfo.callId);
            intent.PutExtra("Type", 0);
            //=========乐橙==========
            intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken);
            intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId);
            intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("China") ? 0 : 1);//如果域名包含china,则是国内账号);
            intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken);
            intent.PutExtra("Psk", mESVideoInfo.Lc_Psk);
            Shared.Application.Activity.StartActivity(intent);
#endif
        }
        /// <summary>
        /// 被呼叫页面
        /// </summary>
        /// <param name="mESVideoInfo"></param>
        public void ShowESvideoVideoIntercom(ESVideoInfo mESVideoInfo)
        public void ShowESvideoVideoIntercom(ESVideoInfo mESVideoInfo, string interphoneType)
        {
            this.esVideoInfo = mESVideoInfo;
#if __IOS__
@@ -108,19 +123,38 @@
            vc.MESCallDelegate = mOnESCallDelegate;
            Shared.Application.currentVC.NavigationController.PushViewController(vc, true);
#else
            #region
            Intent intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity));
            Intent intent = null;
            if (interphoneType == "IMOUVISIAL")
            {
                intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.LeChengVideoActivity));
            }
            else
            {
                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("HomeID", PirSend.HomeId);
            intent.PutExtra("callId", mESVideoInfo.callId);
            intent.PutExtra("Type", 1);
            //=========乐橙==========
            intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken);
            intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId);
            intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("China") ? 0 : 1);//如果域名包含china,则是国内账号);
            intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken);
            intent.PutExtra("Psk", mESVideoInfo.Lc_Psk);
            Shared.Application.Activity.StartActivity(intent);
            #endregion
#endif
        }
@@ -186,7 +220,7 @@
                }
                else
                {
                    Utlis.WriteLine("POST 挂断失败 code: "+ revertObj.Code);
                    Utlis.WriteLine("POST 挂断失败 code: " + revertObj.Code);
                }
            })
@@ -260,6 +294,7 @@
        }
        DateTime UnlockDateTime = DateTime.MinValue;
        /// <summary>
        /// 开锁成功
        /// </summary>
@@ -270,9 +305,9 @@
            if (CheckESVideoInfoIsNullOrEmpty()) return;
            //3S内不允许触发第二次
            if(UnlockDateTime.AddSeconds(3) > DateTime.Now)
            if (UnlockDateTime.AddSeconds(3) > DateTime.Now)
            {
                Utlis.WriteLine("3S内不允许触发第二次");
                //丰林SDKbug,呼叫的时候开锁成功会有2次回调,
                return;
@@ -300,10 +335,10 @@
            { IsBackground = false }.Start();
        }
#endregion
        #endregion
#if __IOS__
#region OnESCallDelegate
        #region OnESCallDelegate
        /////// <summary>
        /////// OnESCallDelegate 继承响应事件
        /////// </summary>
@@ -371,7 +406,7 @@
        }
#endregion
        #endregion
#endif
        /// <summary>
@@ -384,23 +419,23 @@
            {
                DeviceName = "室外机88",
                ESVideoUUID = "JJY000019VPLLF",
            };
            if (isMonitor)
            {
                ShowESVideoMonitor(eSVideoInfo);
                ShowESVideoMonitor(eSVideoInfo, "");
            }
            else
            {
                eSVideoInfo.callId = "88888";
                ShowESvideoVideoIntercom(eSVideoInfo);
                ShowESvideoVideoIntercom(eSVideoInfo, "");
            }
        }
    }
    /// <summary>
    ///
    /// 可视对讲参数对象(仅在最后一步跳转到activity时才调用,为了做兼容这里都数据有点乱,以后有时间再理顺思路优化)
    /// </summary>
    public class ESVideoInfo
    {
@@ -439,9 +474,34 @@
        /// </summary>
        public string callId = string.Empty;
        //========================大华==========================
        /// <summary>
        /// 账号accessToken
        /// </summary>
        public string Lc_AccessToken = string.Empty;
        /// <summary>
        /// 设备序列号,通讯必要字段
        /// </summary>
        public string Lc_DeviceId = string.Empty;
        /// <summary>
        /// 备注???
        /// </summary>
        public string Lc_Psk = string.Empty;
        /// <summary>
        /// 预览画面必须使用
        /// </summary>
        public string Lc_PlayToken = string.Empty;
        /// <summary>
        /// 账号标记:0国内,1国外;国内国外访问都地址不一样
        /// </summary>
        public int Lc_Location = 0;
    }
}