How to upload video using vimeo SDK com.vimeo.networking:vimeo-networking
?
In the documentation and example project there is no example how to upload video. Also methods VimeoClient.getInstance().putContent
and VimeoClient.getInstance().postContent
are not documented. I've implemented method:
VimeoClient.getInstance().postContent(videoUri, CacheControl.FORCE_CACHE, null, new ModelCallback<Video>(Video.class) {
@Override
public void success(Video video) {
toast("Staff Picks Success! " + video);
}
@Override
public void failure(VimeoError error) {
toast("Staff Picks Failure :( " + error);
}
});
but I'm receiving error when try to upload video. Here is stack trace
W/System.err: java.lang.IllegalArgumentException: url == null W/System.err: at okhttp3.Request$Builder.url(Request.java:121) W/System.err: at retrofit2.RequestBuilder.build(RequestBuilder.java:204) W/System.err: at retrofit2.RequestFactory.create(RequestFactory.java:67) W/System.err: at retrofit2.OkHttpCall.createRawCall(OkHttpCall.java:122) W/System.err: at retrofit2.OkHttpCall.enqueue(OkHttpCall.java:58) W/System.err: at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall.enqueue(ExecutorCallAdapterFactory.java:57) W/System.err: at com.vimeo.networking.VimeoClient.POST(VimeoClient.java:1167) W/System.err: at com.vimeo.networking.VimeoClient.postContent(VimeoClient.java:1061)
The Vimeo Networking library you are referring to does not support upload; a separate upload library will be released at a later date. In order to upload you will need to follow the API documentation yourself.
As the documentation states, it's a several step process. We have simplified the process down to 2 steps, however, it is not yet available to the public. Since there was no open sourced 4 step java library, we are not yet releasing the simplified java version until we open it up to the public, which is different than our iOS counterpart.
Unfortunately for now you will need to follow those API docs if you wish to upload in Android.