"Invalid state" on vimeo video upload from other android app
Asked Answered
D

1

7

I am trying the upload videos into vimeo from my android application. The video is getting uploaded . But when the Delete request is called in order to get the video id , I am getting a response as "Invalid state". The same piece of code works in Htc X. Is this the issue with video codec format or something else ?

This is my piece of code for delete request

public void vimeoDelete() {

    // Vimeo upload step 3

    RestClient.mEndPoint.setUrl(APIHandler.VIMEO_BASE_URL);
    RestClient.getVimeo().deleteVideo(mCompleteUri.substring(1), new Callback<Response>() {
        @Override
        public void success(Response response, Response response2) {
            Log.i("Delete", "Done");
            Log.i("Header", response2.getHeaders().toString());
            Log.i("Body", response2.getBody().toString());
            List<Header> aHeaders = response2.getHeaders();
            for (Header aHeader : aHeaders) {
                if (aHeader.getName().equals("Location")) {
                    mVideoUrlLocation = aHeader.getValue();

                }
            }
            Log.i("Location", mVideoUrlLocation);
            mFinalVideoUrl = mVideoUrlLocation.substring(8);
            saveDetails();
        }

        @Override
        public void failure(RetrofitError error) {
            mProgress.dismiss();

        }
    });

}

Can anyone suggest a solution to this .

Regards

Decibel answered 17/11, 2015 at 10:31 Comment(5)
Are you receiving "invalid state" from the response of the delete request, or is "invalid state" an android error? If it's from the response of the delete request, Vimeo can help you debug further. send the whole upload_link and response to vimeo.com/help/contactAmericanism
It is the reponse from the delete request. Okay will contact vimeoDecibel
Is there a solution to this issue? We are experiencing the same in a web-context (non-android related).Riboflavin
Likewise, was there ever a solution to this?Molton
Same problem solved here: https://mcmap.net/q/1629821/-vimeo-upload-api-quot-invalid-state-quot-error-trying-to-delete-the-ticket Hope it helps!Secularism
E
0

I just replied to the same issue over on the Vimeo forum - I had the same issue and am simply posting it here as there didn't seem to be a solution on this particular thread.

Also, regarding your post - there's not a lot of information provided in your post. Your delete request is not all that's required - the assumption would be that you created a valid ticket request, uploaded properly, THEN tried the del request you posted.

Vimeo post: https://vimeo.com/forums/api/topic:278394

My solution: I solved my version of the issue - I think Vimeo corrected some stuff on their API recently because my code did not have a bug and then suddenly one appeared recently. I would bet they added rate limiting on their API gateway or potentially overwriting existing requests to clean up old requests...

Anyhow, here is my fix:

In order to complete a video upload via "Resumable HTTP PUT uploads" (developer.vimeo.com/api/upload/videos), there are 5 steps.

I do everything but the upload through my PHP backend. I was requesting a ticket through PHP as to not expose some secret info through my modified JS frontend (github.com/websemantics/vimeo-upload) but I had not edited out the ticket request properly through the JS code, so the current bug was probably being triggered on that second invalid request (i.e. overwriting or rate limiting my initial valid request through PHP). Once I bypassed the JS "upload" function properly and jumped right to JS "sendFile_", the upload works properly again.

Hope that helps somebody out there!

Elson answered 25/6, 2016 at 16:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.