C# 视频监控系列(13):H264播放器——控制播放和截图
2009-04-08 08:23:29 来源:WEB开发网C# Code:
int m_nSpeed;
/// <summary>
/// 快进
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnFastForward_Click(object sender, EventArgs e)
{
if (HikPlayer.Hik_PlayM4_Fast(PORT))
{
m_nSpeed++;
if (m_nSpeed > 0)
OnThrow2();
}
}
/// <summary>
/// 慢放
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnFastBackward_Click(object sender, EventArgs e)
{
//慢速播放
if (HikPlayer.Hik_PlayM4_Slow(PORT))
{
//timer1.Interval
m_nSpeed--;
if (m_nSpeed <= 0)
OnThrow0();
}
}
public void OnThrow0()
{
HikPlayer.Hik_PlayM4_ThrowBFrameNum(PORT, 0);
}
public void OnThrow2()
{
HikPlayer.Hik_PlayM4_ThrowBFrameNum(PORT, 2);
}
代码说明:
1. 注意关于这两个函数API的说明:
Hik_PlayM4_Fast:快速播放,每次调用将使当前播放速度加快一倍,最多调用4次;要恢复正常播放调用Hik_PlayM4_Play(),从当前位置开始正常播放。
更多精彩
赞助商链接