VideoStatus status = new VideoStatus();
status.setPrivacyStatus("public");
videoObjectDefiningMetadata.setStatus(status);
// Most of the video's metadata is set on the VideoSnippet object.
VideoSnippet snippet = new VideoSnippet();
// This code uses a Calendar instance to create a unique name and
// description for test purposes so that you can easily upload
// multiple files. You should remove this code from your project
// and use your own standard names instead.
Calendar cal = Calendar.getInstance();
snippet.setTitle("Test Upload via Java on " + cal.getTime());
snippet.setDescription(
"Video uploaded via YouTube Data API V3 using the Java library " + "on " + cal.getTime());
// Set the keyword tags that you want to associate with the video.
List<String> tags = new ArrayList<String>();
tags.add("test");
tags.add("example");
tags.add("java");
tags.add("YouTube Data API V3");
tags.add("erase me");
snippet.setTags(tags);
// Add the completed snippet object to the video resource.
videoObjectDefiningMetadata.setSnippet(snippet);
InputStreamContent mediaContent = new InputStreamContent(VIDEO_FILE_FORMAT,