C# Code:
//是否暫停
private bool isPause;
/// <summary>
/// 播放
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPlay_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(m_strPlayFileName))
{
//是否暫停->播放
if (isPause)
{
HikPlayer.Hik_PlayM4_Pause(PORT, false);
isPause = false;
}
else
OpenFile();
}
}
/// <summary>
/// 暫停
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPause_Click(object sender, EventArgs e)
{
HikPlayer.Hik_PlayM4_Pause(PORT, true);
isPause = true;
}
/// <summary>
/// 停止
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnStop_Click(object sender, EventArgs e)
{
HikPlayer.Hik_PlayM4_Stop(PORT);
HikPlayer.Hik_PlayM4_CloseFile(PORT);
HikPlayer.Hik_PlayM4_RealeseDDraw();
pVideo.Invalidate(true);
}