I am trying to upload a video to YouTube using the Java API like this:
private Video uploadVideo(final YouTube youtube, final Video video, final InputStreamContent mediaContent)
throws IOException {
YouTube.Videos.Insert videoInsert = youtube.videos().insert("snippet,statistics,status", video, mediaContent);
MediaHttpUploader uploader = videoInsert.getMediaHttpUploader();
uploader.setDirectUploadEnabled(false);
uploader.setProgressListener(progressListener);
return videoInsert.execute();
}
}
I have a slow and instable internet connection and it would be really helpful if I could get resumable uploads to work. The documentation here and here seem to suggest to me that the "setDirectUploadEnabled(false)" should completely do the trick. Well... obviously it does not.
If my internet connection is interrupted an IOException is thrown and there is no automatic upload resume.
How can I resume an upload?