public DownloadProgress GetNVSProgress(DownloadInfo info)
        {
            try
            {
                Log.Info("NVS", "GetNVSProgress->:" + info);
                if (info == null)
                {
                    return(null);
                }

                DownloadProgress progress = new DownloadProgress();
                progress.DId = info.DId;

                PlayBackForm form1      = NVSManage.Form;
                var          downloader = form1.downloader;
                if (downloader == null)
                {
                    progress.Progress     = 0;
                    progress.ProgressText = "downloader == null";
                    progress.IsFinished   = false;
                }
                else
                {
                    if (downloader.m_iDLTimeId != -1 && downloader.m_iDLTimeId != info.DId)//当前下载的文件不是客户端申请的,多个客户端下载文件的话。
                    {
                        progress.Progress     = 0;
                        progress.ProgressText = "downloader.m_iDLTimeId != info.DId";
                        progress.IsFinished   = false;
                    }
                    else
                    {
                        progress.Progress     = downloader.Progress;
                        progress.ProgressText = downloader.ProgressText;
                        progress.IsFinished   = downloader.IsFinished;
                        if (progress.IsFinished)
                        {
                            progress.Url = downloader.GetUrl(NVSManage.RTMP_Host);
                            if (!progress.Url.StartsWith("http"))
                            {
                                Log.Error("NVS", progress.Url);
                            }
                            else
                            {
                                Log.Info("NVS", "GetNVSProgress Finished !!!!!!!!:" + progress);
                            }
                        }
                    }
                }
                Log.Info("NVS", "GetNVSProgress<-:" + progress);
                return(progress);
            }
            catch (Exception e)
            {
                Log.Error("LocationService.GetNVSProgress", e.ToString());
                return(null);
            }
        }
Ejemplo n.º 2
0
        private static PlayBackForm Init(string ip)
        {
            PlayBackForm form = new PlayBackForm();

            form.SetLoginInfo(ip, NVRPort, NVRUser, NVRPass);
            //form.Login();
            form.AutoLogin        = true;
            form.IsShowMessageBox = false;
            form.Show();

            if (FormDict.ContainsKey(ip))
            {
                FormDict[ip] = form;
            }
            else
            {
                FormDict.Add(ip, form);
            }
            return(form);
        }
Ejemplo n.º 3
0
 public static void Init()
 {
     Form = Init(NVRIP);
 }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            PlayBackForm playBackForm = new PlayBackForm();

            playBackForm.Show();
        }