Open GoogleCodeExporter opened 9 years ago
Hi,
I am getting same exception thoough my video get uploaded successfully...can
anybody tell why this exception occur? I am using gdata-youtube-2.0.jar
below is my code...
File videoFile = new File(videoFilename);
if (!videoFile.exists() || !videoFile.isFile() || !videoFile.canRead()) {
throw new IOException("File '" + videoFilename + "' must be an existing reabable file in order to upload to YouTube!");
}
VideoEntry newEntry = new VideoEntry();
YouTubeMediaGroup mg = newEntry.getOrCreateMediaGroup();
mg.addCategory(new MediaCategory(YouTubeNamespace.CATEGORY_SCHEME, "Tech"));
mg.setTitle(new MediaTitle());
mg.getTitle().setPlainTextContent(videoTitle);
mg.setKeywords(new MediaKeywords());
mg.getKeywords().addKeyword("gdata-test");
mg.setDescription(new MediaDescription());
mg.getDescription().setPlainTextContent(videoTitle);
MediaFileSource ms = new MediaFileSource(videoFile, mimeType);
newEntry.setMediaSource(ms);
try {
service.insert(new URL(VIDEO_UPLOAD_FEED), newEntry);
} catch (ServiceException se) {
System.out.println("Sorry, your upload was invalid:");
System.out.println(se.getResponseBody());
throw new MioException("Failed to upload video: " + videoFilename, se);
}
Original comment by mioevery...@gmail.com
on 18 Mar 2013 at 7:39
Original issue reported on code.google.com by
avi.du...@gmail.com
on 25 Nov 2012 at 3:13