/// <summary> /// 停止播放流媒体 /// </summary> public void StopPlay() { this.btnPlay.Enabled = false; if (ChannelId > 0) { if (this.btnRecord.Checked) { // 正在录制则进行停止 LogAppend("正在停止视频录制..."); // 停止录像 this.btnRecord.Checked = false; PlayerMethods.CarEyePlayer_StopManuRecording(ChannelId); LogAppend("视频录制已停止."); } // 预览停止代码 PlayerMethods.CarEyePlayer_CloseStream(ChannelId); UrlApiHelper.ControlVideo(Token.TerminalId, Token.LogicChn, VedioControlType.Stop); ChannelId = -1; } LinkToken(null); mImagePath = null; mVideoPath = null; UpdateDisplayStatus(); }
/// <summary> /// 控件销毁时进行资源释放 /// </summary> /// <param name="e"></param> protected override void OnHandleDestroyed(EventArgs e) { // 释放资源 if (ChannelId > 0) { // 相应资源回收处理代码 PlayerMethods.CarEyePlayer_CloseStream(ChannelId); ChannelId = -1; } base.OnHandleDestroyed(e); }