private void StartPlayVideo(string filename) { if (filename != "") { StopVideo(); if (PlayCtrl.PlayM4_GetPort(ref m_lPort)) { m_ptrRealHandle = picPlayBack.Handle; m_FileRefDone = new PlayCtrl.PFILEREFDONE(PlayCallBack); if (PlayCtrl.PlayM4_SetFileRefCallBack(m_lPort, m_FileRefDone, 0)) { } if (PlayCtrl.PlayM4_OpenFile(m_lPort, filename)) { if (PlayCtrl.PlayM4_Play(m_lPort, m_ptrRealHandle)) { m_CurPlayState = PlayState.PlayNormal; SetCtrlEnable(); } else { uint error = PlayCtrl.PlayM4_GetLastError(m_lPort); } } } else { uint error = PlayCtrl.PlayM4_GetLastError(m_lPort); } } }
private void replay_Load(object sender, EventArgs e) { if (path == null) { Close(); MessageBox.Show("未选择有效文件"); return; } Boolean flag = PlayCtrl.PlayM4_OpenFile(0, path); Console.WriteLine(flag ? "文件打开成功" : "文件打开失败"); PlayCtrl.PlayM4_SetPicQuality(0, 1); PlayCtrl.PlayM4_SetPlayPos(0, 0); label3.Text = GetTime(PlayCtrl.PlayM4_GetFileTime(0)); }