示例#1
0
        /// <summary>
        /// Download location
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDLLocation_Click(object sender, EventArgs e)
        {
            if (m_ClientInfo.m_iServerID == -1 || m_ulConnID == -1)
            {
                return;
            }


            int iPos = 0;

            try
            {
                iPos = Convert.ToInt32(tbDLLocation.Text.ToString());
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("Please input the Number: 0~100!" + ex.Message);
            }


            if (iPos >= 0 && iPos < 100)
            {
                NVSSDK.NetClient_NetFileDownloadFile(ref m_ulConnID, m_ClientInfo.m_iServerID, "", "", 1, iPos, -1);
                if (m_iPlayerID >= 0)
                {
                    PLAYSDK.TC_CleanStreamBuffer(m_iPlayerID);
                }
            }
        }
示例#2
0
        public void StartDownloadByFile()
        {
            DoCallBack = new ReplayCallBackDelegate(DoCallBackFunction);

            int iRet = NVSSDK.NetClient_NetFileDownloadFile(ref m_ulConnID, m_ClientInfo.m_iServerID, m_szFileName.ToString(), "", 0, -1, 2);

            if (iRet >= 0)
            {
                IntPtr temp = IntPtr.Zero;
                int    irt  = NVSSDK.NetClient_SetNetFileDownloadFileCallBack(m_ulConnID, DoCallBack, temp);
            }
            else
            {
                //if (m_ulConnID != -1)  // INVALID_ID)
                {
                    NVSSDK.NetClient_NetFileStopDownloadFile(m_ulConnID);
                    //m_ulConnID = -1;
                }
            }
        }
示例#3
0
        public void ContinueDownload()
        {
            if (m_ClientInfo.m_iServerID == -1 || m_ulConnID == -1)
            {
                return;
            }

            if (m_iDownloadPause == 1)
            {
                int iState = 0;
                int iRet   = PLAYSDK.TC_GetStreamPlayBufferState(m_iPlayerID, ref iState);
                if (iRet == 0)
                {
                    if (iState == -19)             //RET_BUFFER_WILL_BE_EMPTY )
                    {
                        //iRet = NVSSDK.NetClient_NetFileDownloadFile(ref m_ulConnID, m_ClientInfo.m_iServerID, m_szFileName, "", 1, -1, 1);
                        iRet             = NVSSDK.NetClient_NetFileDownloadFile(ref m_ulConnID, m_ClientInfo.m_iServerID, "", "", 1, -1, 1);
                        m_iDownloadPause = 0;
                    }
                }
            }
        }
示例#4
0
        private void btnDLSpeedChange_Click(object sender, EventArgs e)
        {
            if (m_ClientInfo.m_iServerID == -1 || m_ulConnID == -1) //|| m_iDownloadPause)
            {
                return;
            }

            int iSpeed = 0;

            try
            {
                iSpeed = Convert.ToInt32(tbDLSpeed.Text.ToString());
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("Please input the Number: 0~16!" + ex.Message);
            }
            if (iSpeed >= 0 && iSpeed <= 16)
            {
                m_iDownloadSpeed = iSpeed;
                NVSSDK.NetClient_NetFileDownloadFile(ref m_ulConnID, m_ClientInfo.m_iServerID, "", "", 1, -1, iSpeed);
            }
        }