private void PlayerTime_Tick(object sender, EventArgs e) { try { PlayHelp.PLAY_STATE state = (PlayHelp.PLAY_STATE)_Player.GetState(); if (state == PlayHelp.PLAY_STATE.PS_PLAY || state == PlayHelp.PLAY_STATE.PS_PAUSED) { _ScrollChange = PlayHelp.Scrol_State.NormalMove; _Position = _Player.GetPosition(); _Duration = _Player.GetDuration(); this.trackBar.Maximum = _Duration; this.trackBar.Value = _Position; Lb_NowTime.Text = ph.GetTime(_Position); Lb_AllTime.Text = ph.GetTime(_Duration); Btn_Player.Text = "暂停"; } else { _Position = 0; this.trackBar.Value = 0; Btn_Player.Text = "播放"; } } catch (Exception ex) { MessageBox.Show(string.Format("播放视频时出现异常!\r\n\r\n异常信息[{0}]", ex.Message), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void trackBar_MouseDown(object sender, MouseEventArgs e) { try { if (e.Button == MouseButtons.Left) { _ScrollChange = PlayHelp.Scrol_State.MoveBegin; _Volume = _Player.GetVolume(); _PlayerTime.Stop(); } } catch (Exception ex) { MessageBox.Show(string.Format("播放视频出现异常!\r\n\r\n异常信息[{0}]", ex.Message), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }