Beispiel #1
0
        private void btnPlaySpeedChange_Click(object sender, EventArgs e)
        {
            if (m_ClientInfo.m_iServerID == -1 || m_ulConnID == -1)
            {
                return;
            }

            int iSpeed = 0;

            try
            {
                iSpeed = Convert.ToInt32(tbPlaySpeed.Text.ToString());
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("Please input the Number: -4~4!" + ex.Message);
            }
            if (m_iPlayerID != -1)
            {
                if (iSpeed != 0 & iSpeed > -4 & iSpeed < 4)
                {
                    PLAYSDK.TC_FastForward(m_iPlayerID, iSpeed);
                }
                else
                {
                    PLAYSDK.TC_Play(m_iPlayerID);
                }
            }
        }
Beispiel #2
0
 private void DoCallBackFunction(UInt32 _ulID, IntPtr _ucData, Int32 _iLen,
                                 Int32 _iFlag,
                                 Int32 _lpUserData)
 {
     if (_ulID == m_ulConnID)
     {
         if (_iFlag == 1)    //处理文件头
         {
             if (m_iPlayerID == -1)
             {
                 Control.CheckForIllegalCrossThreadCalls = false;
                 m_iPlayerID = PLAYSDK.TC_CreatePlayerFromVoD(pnlVideoPlay.Handle, _ucData, _iLen);//创建VOD播放器
                 if (m_iPlayerID >= 0)
                 {
                     int i = PLAYSDK.TC_Play(m_iPlayerID);//播放
                     if (i < 0)
                     {
                         MessageBox.Show(m_iPlayerID.ToString() + "TC_Play faild");
                     }
                     i = PLAYSDK.TC_PlayAudio(m_iPlayerID);
                     if (i < 0)
                     {
                         MessageBox.Show(m_iPlayerID.ToString() + "TC_PlayAudio faild");
                     }
                 }
                 else
                 {
                     MessageBox.Show("CreatePlayerFromVoD failed!\n");
                 }
             }
         }
         else    //处理数据
         {
             int i = PLAYSDK.TC_PutStreamToPlayer(m_iPlayerID, _ucData, _iLen);
             //if (i < 0)
             //{
             //    MessageBox.Show(m_iPlayerID.ToString() + "TC_PutStreamToPlayer faild");
             //}
             //CheckStatus();
         }
     }
 }