1

After a few seconds from the beginning of the video upload process, the progress bar stops without displaying any errors. I notice that the code freeze in attempt to execute uploader.uploadChunk() (after a few successful attempts). My previous question was Vimeo upload : unexpected status code (404) while resuming upload, so after changes I made I am sure that I have the correct upload_link

The code sample of my app is given below:

        HashMap<String, String> headers = new HashMap<>();
        headers.put("Tus-Resumable", "1.0.0");
        headers.put("Authorization", getAuthHeader());
        headers.put("Accept", getAcceptHeader());
        headers.put("Content-Type", "application/offset+octet-stream");
        headers.put("Upload-Length", "" + upload.getSize());
        headers.put("Connection", "Keep-Alive");
        client.setHeaders(headers);

        TusUploader uploader = client.beginOrResumeUploadFromURL(upload, client.getUploadCreationURL());
        long totalBytes = upload.getSize();
        long uploadedBytes = uploader.getOffset();

        uploader.setChunkSize(1024);

        while (!isCancelled() && uploader.uploadChunk() > 0) {
            uploadedBytes = uploader.getOffset();
            publishProgress(uploadedBytes, totalBytes);
        }

        uploader.finish();
        return uploader.getUploadURL();

Also, here is the screenshot of my app: As you can see, upload progress is nearly 5 % completed

0 Answers0