示例#1
0
 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);
         }
     }
 }