private void button1_Click(object sender, EventArgs e) { if (!play && PlayCtrl.PlayM4_Play(0, pictureBox1.Handle)) { button1.Text = "暂停"; play = true; Console.WriteLine("播放成功"); } else { if (!m_bPause) { PlayCtrl.PlayM4_Pause(0, 1); button1.Text = "继续播放"; m_bPause = true; Console.WriteLine("暂停成功"); } else { PlayCtrl.PlayM4_Pause(0, 0); button1.Text = "暂停"; m_bPause = false; Console.WriteLine("恢复播放成功"); } } }
private void PausePlayBack() { //先暂停网络库 uint temp = 0; bool IsNetPause = CHCNetSDK.NET_DVR_PlayBackControl(m_lPlayBackHandle, CHCNetSDK.NET_DVR_PLAYPAUSE, 0, ref temp); //再暂停播放库 bool IsPlayCtrlPause = PlayCtrl.PlayM4_Pause(m_PlayBackPort, 1); }
private void ResumePalyBack() { //先暂停网络库 uint temp = 0; bool IsNetPause = CHCNetSDK.NET_DVR_PlayBackControl(m_lPlayBackHandle, CHCNetSDK.NET_DVR_PLAYRESTART, 0, ref temp); //再暂停播放库 bool IsPlayCtrlPause = PlayCtrl.PlayM4_Pause(m_PlayBackPort, 0); }
private void sbtnPause_Click(object sender, EventArgs e) { if (sbtnPause.Text == "暂停") { sbtnPause.Text = "恢复"; //this.btnPause.Image = global::HikHelp.Properties.Resources.恢复; if (PlayCtrl.PlayM4_Pause(m_lPort, 1)) { m_CurPlayState = PlayState.PlayPause; SetCtrlEnable(); } } else if (sbtnPause.Text == "恢复") { sbtnPause.Text = "暂停"; //this.btnPause.Image = global::HikHelp.Properties.Resources.暂停; if (PlayCtrl.PlayM4_Pause(m_lPort, 0)) { m_CurPlayState = PlayState.PlayRestore; SetCtrlEnable(); } } }