private void OnPlayReady(VideoStatusInfo info)
        {
            bool             isFind = false;
            XtraSinglePlayer player = null;

            if (m_player.HWnd == info.HWnd)
            {
                player = m_player;
                isFind = true;
            }


            if (!isFind)
            {
                return;
            }
            player.EnabledEx = true;
            player.SetStatusText("");
            try
            {
                player.PlayVideoName = Framework.Container.Instance.TaskManagerService.GetTaskUnitById(info.VideoTaskUnitID).TaskUnitName;
                UpdateButtonStatus(info.HWnd);
                //Framework.Container.Instance.GraphicDrawService.SetPlayDrawType(m_drawMode);
            }
            catch (SDKCallException ex)
            {
                Common.SDKCallExceptionHandler.Handle(ex, "根据编号获取任务单元");
            }
        }
示例#2
0
        private void OnPlayPosChanged(VideoStatusInfo info)
        {
            bool             isFind = false;
            XtraSinglePlayer player = null;

            if (m_player.HWnd == info.HWnd)
            {
                player = m_player;
                isFind = true;
            }


            if (!isFind)
            {
                return;
            }

            UpdateButtonStatus(info.HWnd);
            TimeInfo = string.Format("{0}/{1}", new DateTime().AddSeconds(info.CurrPlayTime).ToString("HH:mm:ss"), new DateTime().AddSeconds(info.TotlePlayTime).ToString("HH:mm:ss"));
            RaisePropertyChangedEvent("TimeInfo");

            if (info.PlayState == VideoStatusType.E_STOP)
            {
                //player.PlayVideoName = "";
                player.EnabledEx = false;
                player.SetStatusText("");
            }
            else
            {
                if (PlayPosChange != null)
                {
                    PlayPosChange(player, info.CurrPlayTime, info.TotlePlayTime);
                }
            }
        }
示例#3
0
        private void OnPlayReady(VideoStatusInfo info)
        {
            bool             isFind = false;
            XtraSinglePlayer player = null;

            foreach (KeyValuePair <int, XtraSinglePlayer> pair in m_playerList)
            {
                if (pair.Value.HWnd == info.HWnd)
                {
                    player = pair.Value;
                    isFind = true;
                    break;
                }
            }


            if (!isFind)
            {
                return;
            }

            player.EnabledEx = true;
            player.SetStatusText("");
            UpdateButtonStatus(info.HWnd);
        }
        private void OnOpenBriefPlaybackVideo(VodInfo info)
        {
            m_player.PlayVideoName = "";
            m_player.IsSuitWnd     = false;
            m_player.EnabledEx     = false;
            m_player.SetStatusText("");
            try
            {
                Framework.Container.Instance.VideoPlayService.OpenVideo(m_player.HWnd, info.VideoTaskUnitID, info.StartTime, info.EndTime, true, true);
                uint w = 0;
                uint h = 0;
                Framework.Container.Instance.VideoPlayService.GetPlayResolution(m_player.HWnd, out w, out h);
                m_player.SetPlayResolution(w, h);
            }
            catch (SDKCallException ex)
            {
                Common.SDKCallExceptionHandler.Handle(ex, "摘要回放");
            }

            this.UpdateButtonStatus(m_player.HWnd);
        }
示例#5
0
 public void CloseVideo(XtraSinglePlayer player)
 {
     try
     {
         Framework.Container.Instance.VideoPlayService.StopVideo(player.HWnd);
         player.PlayVideoName = "";
         player.EnabledEx     = false;
         player.SetStatusText("");
         TimeInfo = "00:00:00/00:00:00";
         UpdateButtonStatus(player.HWnd);
     }
     catch (SDKCallException ex)
     {
         Common.SDKCallExceptionHandler.Handle(ex, "关闭视频");
     }
 }
示例#6
0
        private void OnPlayPosChanged(VideoStatusInfo info)
        {
            XtraSinglePlayer player = GetPlayerByPlayHandle(info.HWnd);

            if (player == null)
            {
                return;
            }

            if (CurrPlayer == player)
            {
                try
                {
                    VideoStatusInfo e = Framework.Container.Instance.VideoPlayService.GetPlayStatus(info.HWnd);
                    if (e.PlayStatePriv != e.PlayState)
                    {
                        SetPlayVideoBtnStatus(e);
                    }

                    TimeInfo = string.Format("{0}/{1}", new DateTime().AddSeconds(e.CurrPlayTime).ToString("HH:mm:ss"), new DateTime().AddSeconds(e.TotlePlayTime).ToString("HH:mm:ss"));
                    RaisePropertyChangedEvent("TimeInfo");
                }
                catch (SDKCallException ex)
                {
                    Common.SDKCallExceptionHandler.Handle(ex, "获取播放状态");
                }
            }

            if (info.PlayState == VideoStatusType.E_STOP)
            {
                //player.PlayVideoName = "";
                player.EnabledEx = false;
                player.SetStatusText("");
            }
            else
            {
                if (PlayPosChange != null)
                {
                    PlayPosChange(player, info.PlayPercent);
                }
            }
        }
        private void OnPlayReady(VideoStatusInfo info)
        {
            bool             isFind = false;
            XtraSinglePlayer player = null;

            if (m_player.HWnd == info.HWnd)
            {
                player = m_player;
                isFind = true;
            }


            if (!isFind)
            {
                return;
            }
            player.EnabledEx = true;
            player.SetStatusText("");
            this.UpdateButtonStatus(info.HWnd);
        }
        private void OnPlayPosChanged(VideoStatusInfo info)
        {
            bool             isFind = false;
            XtraSinglePlayer player = null;

            if (m_player.HWnd == info.HWnd)
            {
                player = m_player;
                isFind = true;
            }


            if (!isFind)
            {
                return;
            }

            this.UpdateButtonStatus(info.HWnd);

            if (info.PlayState == VideoStatusType.E_STOP)
            {
                //player.PlayVideoName = "";
                player.EnabledEx = false;
                player.SetStatusText("");
            }
            else
            {
                if (PlayPosChange != null)
                {
                    if (info.StartPlayTime == 0 && info.EndPlayTime == 0)
                    {
                        PlayPosChange(player, info.PlayPercent, 1000);
                    }
                    else
                    {
                        PlayPosChange(player, info.CurrPlayTime - info.StartPlayTime, info.EndPlayTime - info.StartPlayTime);// info.PlayPercent);
                    }
                }
            }
        }
示例#9
0
        private void OnPlayReady(VideoStatusInfo info)
        {
            bool             isFind = false;
            XtraSinglePlayer player = null;

            if (m_player.HWnd == info.HWnd)
            {
                player = m_player;
                isFind = true;
            }


            if (!isFind)
            {
                return;
            }

            player.EnabledEx = true;
            player.SetStatusText("");

            try
            {
                VideoStatusInfo e = Framework.Container.Instance.BriefVideoPlayService.GetPlayStatus(info.HWnd);
                SetPlayVideoBtnStatus(e);

                //string newtime = string.Format("浓缩时长:{0}分{1}秒", e.TotlePlayTime / 60, e.TotlePlayTime % 60);
                //if (newtime != TimeInfo)
                //{
                //    TimeInfo = newtime;
                //    RaisePropertyChangedEvent("TimeInfo");
                //}
            }
            catch (SDKCallException ex)
            {
                Common.SDKCallExceptionHandler.Handle(ex, "获取播放状态");
            }
        }
        public void PlayOrPauseVideo()
        {
            try
            {
                VideoStatusInfo e
                    = Framework.Container.Instance.VideoPlayService.GetPlayStatus(m_player.HWnd);

                if (e.PlayState == VideoStatusType.E_NORMAL)
                {
                    Framework.Container.Instance.VideoPlayService.VideoControl(m_player.HWnd, E_VDA_PLAYCTRL_TYPE.E_PLAYCTRL_PAUSE, 0);
                    m_player.SetStatusText("暂停");
                }
                else if (e.PlayState == VideoStatusType.E_PAUSE)
                {
                    Framework.Container.Instance.VideoPlayService.VideoControl(m_player.HWnd, E_VDA_PLAYCTRL_TYPE.E_PLAYCTRL_RESUME, 0);
                    m_player.SetStatusText(GetSpeedText((int)e.PlaySpeed));
                }
                else if (e.PlayState == VideoStatusType.E_STOP)
                {
                    if (e.StartPlayTime == 0 && e.EndPlayTime == 0)
                    {
                        Framework.Container.Instance.VideoPlayService.VideoControl(m_player.HWnd, E_VDA_PLAYCTRL_TYPE.E_PLAYCTRL_START, 0);
                        m_player.EnabledEx = true;
                        m_player.SetStatusText("");
                    }
                    else
                    {
                        ReplayBackVideo();
                    }
                }
                else if (e.PlayState == VideoStatusType.E_SPEED)
                {
                    Framework.Container.Instance.VideoPlayService.VideoControl(m_player.HWnd, E_VDA_PLAYCTRL_TYPE.E_PLAYCTRL_PAUSE, 0);
                    m_player.SetStatusText("暂停");
                }
                else if (e.PlayState == VideoStatusType.E_STEP || e.PlayState == VideoStatusType.E_STEP_BACK)
                {
                    Framework.Container.Instance.VideoPlayService.VideoControl(m_player.HWnd, E_VDA_PLAYCTRL_TYPE.E_PLAYCTRL_RESUME, 0);
                    m_player.SetStatusText(GetSpeedText((int)e.PlaySpeed));
                }

                VideoStatusInfo e1
                    = Framework.Container.Instance.VideoPlayService.GetPlayStatus(m_player.HWnd);
                SetPlayVideoBtnStatus(e1);
            }
            catch (SDKCallException ex)
            {
                Common.SDKCallExceptionHandler.Handle(ex, "播放或暂停视频");
            }
        }
示例#11
0
        public void PlayOrPauseVideo(bool canReplay = true)
        {
            try
            {
                VideoStatusInfo e
                    = Framework.Container.Instance.BriefVideoPlayService.GetPlayStatus(m_player.HWnd);

                if (e.PlayState == VideoStatusType.E_NORMAL)
                {
                    Framework.Container.Instance.BriefVideoPlayService.VideoControl(m_player.HWnd, E_VDA_BRIEF_PLAYCTRL_TYPE.E_BRIEF_PLAYCTRL_PAUSE, 0);
                    m_player.SetStatusText("暂停");
                }
                else if (e.PlayState == VideoStatusType.E_PAUSE)
                {
                    Framework.Container.Instance.BriefVideoPlayService.VideoControl(m_player.HWnd, E_VDA_BRIEF_PLAYCTRL_TYPE.E_BRIEF_PLAYCTRL_RESUME, 0);
                    m_player.SetStatusText(GetSpeedText((int)e.PlaySpeed));
                }
                else if (e.PlayState == VideoStatusType.E_STOP)
                {
                    if (canReplay)
                    {
                        Framework.Container.Instance.BriefVideoPlayService.VideoControl(m_player.HWnd, E_VDA_BRIEF_PLAYCTRL_TYPE.E_BRIEF_PLAYCTRL_START, 0);
                        m_player.SetStatusText("");
                        m_player.EnabledEx = false;
                    }
                }
                else if (e.PlayState == VideoStatusType.E_SPEED)
                {
                    Framework.Container.Instance.BriefVideoPlayService.VideoControl(m_player.HWnd, E_VDA_BRIEF_PLAYCTRL_TYPE.E_BRIEF_PLAYCTRL_PAUSE, 0);
                    m_player.SetStatusText("暂停");
                }

                VideoStatusInfo e1
                    = Framework.Container.Instance.BriefVideoPlayService.GetPlayStatus(m_player.HWnd);
                SetPlayVideoBtnStatus(e1);
            }
            catch (SDKCallException ex)
            {
                Common.SDKCallExceptionHandler.Handle(ex, "播放或暂停摘要视频");
            }
        }