public void UploadNextChunk() { if (lastChunk != null) { DisposeChunkEvents(lastChunk); } currentChunkIndex++; VideoChunk currentChunk = m_chunks[currentChunkIndex]; RegisterChunkEvents(currentChunk); currentChunk.Upload(); //Store the reference to latest uploaded chunk to de-register events lastChunk = currentChunk; }
private void RequestComplete(string response) { OnRequestComplete -= RequestComplete; JSONNode rawJSON = JSONNode.Parse(response); string tusUploadLink = rawJSON["upload"]["upload_link"].Value; m_vimeoUrl = rawJSON["link"].Value; CreateChunks(m_fileInfo, tusUploadLink); VideoChunk currentChunk = m_chunks[currentChunkIndex]; RegisterChunkEvents(currentChunk); currentChunk.Upload(); if (OnUploadInit != null) { OnUploadInit(response); } }