void vod_VideoStartSave4OCX(object sender, EventArgs e) { IVX.Live.MainForm.View.ucPlayHistory vod = sender as MainForm.View.ucPlayHistory; string fileName = string.Format("视频导出_{0}_{1}.mp4", vod.OCX_StartSecond, vod.OCX_EndSecond); bool needSave = true; fileName = IVX.Live.MainForm.Framework.Environment.VideoSavePath.TrimEnd('\\') + "\\" + fileName; System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog(); sfd.RestoreDirectory = true; sfd.Filter = "*.mp4|*.mp4|全部文件|*.*"; sfd.FileName = System.IO.Path.GetFileName(fileName); sfd.InitialDirectory = IVX.Live.MainForm.Framework.Environment.VideoSavePath; if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { fileName = sfd.FileName; } else { needSave = false; } if (needSave) { try { int handle = m_videoExport.AddExport(vod.OCX_MssHostIp, vod.OCX_MssHostPort, vod.OCX_VideoPath, (uint)vod.OCX_StartSecond, (uint)vod.OCX_EndSecond, fileName); if (handle > 0 && IsHandleCreated && OnVideoSaveStarted != null) { OnVideoSaveStarted(handle, fileName); } } catch (SDKCallException ex) { MessageBoxEx.Show("视频【" + fileName + "】导出失败,[" + ex.ErrorCode + "]" + ex.Message, IVX.Live.MainForm.Framework.Environment.PROGRAM_NAME); } } }
public string Clear() { try { MyLog4Net.Container.Instance.Log.DebugWithDebugView("VODOCX Clear"); //IVX.Live.Crowd.Framework.Container.Instance.LogOut(); if (panelEx1.Controls.Count > 0) { IVX.Live.MainForm.View.ucPlayHistory vod = panelEx1.Controls[0] as IVX.Live.MainForm.View.ucPlayHistory; if (vod != null) { vod.Clear(); this.panelEx1.Controls.Clear(); } m_videoExport.UnInit(); } IVX.Live.MainForm.Framework.Environment.VODPlayControler = null; ocx_VodSdk_UnInit(); } catch (SDKCallException ex) { MyLog4Net.Container.Instance.Log.DebugWithDebugView("VODOCX Clear error:" + ex.ToString()); m_isLogin = false; return(MakeRetMsg(LVErrorType.Err_Clear, "清理出错")); } exit = false; new System.Threading.Thread(sleep).Start(); while (!exit) { System.Threading.Thread.Sleep(20); } MyLog4Net.Container.Instance.Log.DebugWithDebugView("VODOCX Clear No_Error"); return(MakeRetMsg(LVErrorType.No_Error, "")); }