use of com.google.api.services.youtube.model.PlaylistStatus in project opencast by opencast.
the class YouTubeAPIVersion3ServiceImpl method createPlaylist.
@Override
public Playlist createPlaylist(final String title, final String description, final String... tags) throws IOException {
final PlaylistSnippet playlistSnippet = new PlaylistSnippet();
playlistSnippet.setTitle(title);
playlistSnippet.setDescription(description);
if (tags.length > 0) {
playlistSnippet.setTags(Collections.list(tags));
}
// Playlists are always public. The videos therein might be private.
final PlaylistStatus playlistStatus = new PlaylistStatus();
playlistStatus.setPrivacyStatus("public");
// Create playlist with metadata and status.
final Playlist youTubePlaylist = new Playlist();
youTubePlaylist.setSnippet(playlistSnippet);
youTubePlaylist.setStatus(playlistStatus);
// The first argument tells the API what to return when a successful insert has been executed.
final YouTube.Playlists.Insert command = youTube.playlists().insert("snippet,status", youTubePlaylist);
return execute(command);
}
Aggregations