wei
2021-03-31 19e762179bdc9efc23704bc471cf974ed282b43d
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs
@@ -8,62 +8,61 @@
{
    public class VideoMethod
    {
        /// <summary>
        /// 程序主入口
        /// </summary>
        /// <param name="frameLayout">log父控件</param>
        /// <param name="video">可视对讲对象</param>
        public void MianView(FrameLayout frameLayout, VideoClouds video)
        {
            //加载log
            Loading loading = new Loading();
            frameLayout.AddChidren(loading);
            loading.Start();
            List<ESVideoInfo> listESVideoInfo = new List<ESVideoInfo>();
            List<CallView> listCall = new List<CallView>();
            new System.Threading.Thread(() =>
            {
                try
                {
                    listESVideoInfo = VideoSend.GetVideoInfoList(video);
                    listCall = getCall(video.id);
                }
                catch
                {
                }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        var mainView = new MainView();
                        MainPage.BasePageView.AddChidren(mainView);
                        mainView.Show(listESVideoInfo, listCall, video);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 获取可视对讲
        /// </summary>
        /// <param name="action">回调函数</param>
        /// <param name="frame">log父控件</param>
        public void getVideo(Action<VideoClouds> action, FrameLayout frame, bool tag)
        {
            ThreadSend(null, (responsePackNew) =>
             {
                 try
                 {
                     var str = responsePackNew.Data.ToString();
                     var videoObj = Newtonsoft.Json.JsonConvert.DeserializeObject<VideoClouds>(str);
                     action(videoObj);
                 }
                 catch { }
             }, "获取可视对讲", "fram", frame, null, tag);
        }
        ///// <summary>
        ///// 程序主入口
        ///// </summary>
        ///// <param name="frameLayout">log父控件</param>
        ///// <param name="video">可视对讲对象</param>
        //public void MianView(FrameLayout frameLayout, VideoClouds video)
        //{
        //    //加载log
        //    Loading loading = new Loading();
        //    frameLayout.AddChidren(loading);
        //    loading.Start();
        //    List<VideoMethod.FlVideo> listESVideoInfo = new List<VideoMethod.FlVideo>();
        //    List<CallView> listCall = new List<CallView>();
        //    new System.Threading.Thread(() =>
        //    {
        //        try
        //        {
        //            listESVideoInfo = VideoSend.GetVideoInfoList(video);
        //            listCall = getCall(video.id);
        //        }
        //        catch
        //        {
        //        }
        //        finally
        //        {
        //            Application.RunOnMainThread(() =>
        //            {
        //                loading.Hide();
        //                var mainView = new HDL_ON.UI.UI2.FuntionControlView.Video.MainView();
        //                MainPage.BasePageView.AddChidren(mainView);
        //                mainView.Show();
        //                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
        //            });
        //        }
        //    })
        //    { IsBackground = true }.Start();
        //}
        ///// <summary>
        ///// 获取可视对讲
        ///// </summary>
        ///// <param name="action">回调函数</param>
        ///// <param name="frame">log父控件</param>
        //public void getVideo(Action<VideoClouds> action, FrameLayout frame, bool tag)
        //{
        //    ThreadSend(null, (responsePackNew) =>
        //     {
        //         try
        //         {
        //             var str = responsePackNew.Data.ToString();
        //             var videoObj = Newtonsoft.Json.JsonConvert.DeserializeObject<VideoClouds>(str);
        //             action(videoObj);
        //         }
        //         catch { }
        //     }, "获取可视对讲", "fram", frame, null, tag);
        //}
        /// <summary>
        /// 获取历史通话记录
        /// </summary>
@@ -138,7 +137,7 @@
        /// <param name="frame">log父控件</param>
        /// <param name="dialog">log父控件</param>
        /// <param name="tag">是否要显示log</param>
        public static void ThreadSend(VideoClouds videoObj, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, bool tag = true)
        public void ThreadSend(VideoClouds videoObj, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, bool tag = true)
        {
            //加载log
@@ -203,12 +202,14 @@
        }
        [Serializable] 
        public class VideoClouds
        {
        {
            /// <summary>
            /// 丰林绑定id(flBindId)
            /// 丰林绑定id(flBindId)(userKey)
            /// </summary>
            public string id = string.Empty;
            /// <summary>
@@ -296,6 +297,19 @@
           public List<Call> callList = new List<Call>();
        }
        [Serializable]
        public class FlVideo
        {
            /// <summary>
            /// 设备名称
            /// </summary>
            public string aliasName = string.Empty;
            /// <summary>
            /// 设备类型:(1室内机,2室外机,3围墙机,4管理机,5二次确认机)
            /// </summary>
            public string devType = string.Empty;
            public string uuid = string.Empty;
        }
    }
}