Interface YouTubeAPIVersion3Service
- All Known Implementing Classes:
YouTubeAPIVersion3ServiceImpl
public interface YouTubeAPIVersion3Service
Provides convenient access to
YouTube service.-
Method Summary
Modifier and TypeMethodDescriptioncom.google.api.services.youtube.model.PlaylistItemaddPlaylistItem(String playlistId, String videoId) Add a previously uploaded video to specified YouTube playlist.com.google.api.services.youtube.model.VideoaddVideoToMyChannel(VideoUpload videoUpload) Upload a video to predefined YouTube channel.com.google.api.services.youtube.model.PlaylistcreatePlaylist(String title, String description, String... tags) Creates YouTube Playlist and adds it to the authorized account.com.google.api.services.youtube.model.PlaylistgetMyPlaylistByTitle(String title) Get playlist by title.com.google.api.services.youtube.model.PlaylistListResponsegetMyPlaylists(String pageToken, long maxResults) Page through all YouTube playlists of predefined channel.com.google.api.services.youtube.model.PlaylistItemListResponsegetPlaylistItems(String playlistId, String pageToken, long maxResults) Find YouTube playlist by id.com.google.api.services.youtube.model.VideogetVideoById(String videoId) Get video by id.voidinitialize(ClientCredentials credentials) Configure the underlyingYouTubeinstance.voidremoveMyPlaylist(String playlistId) Remove a previously created YouTube playlist.voidremoveMyVideo(String videoId) Remove a previously uploaded video from YouTube.voidremoveVideoFromPlaylist(String playlistId, String videoId) Remove a previously uploaded video from specified YouTube playlist.com.google.api.services.youtube.model.SearchListResponsesearchMyVideos(String queryTerm, String pageToken, long maxResults) Search for videos on predefined channel.
-
Method Details
-
initialize
Configure the underlyingYouTubeinstance.- Parameters:
credentials- may not benull- Throws:
IOException- when configuration files not found.
-
searchMyVideos
com.google.api.services.youtube.model.SearchListResponse searchMyVideos(String queryTerm, String pageToken, long maxResults) throws IOException Search for videos on predefined channel.- Parameters:
queryTerm- may not benullpageToken- may not benullmaxResults- may not benull- Returns:
- zero or more results. Will not be
null. - Throws:
IOException- when search fails.
-
getVideoById
Get video by id.- Parameters:
videoId- may not benull- Returns:
- null when not found.
- Throws:
IOException
-
getMyPlaylistByTitle
com.google.api.services.youtube.model.Playlist getMyPlaylistByTitle(String title) throws IOException Get playlist by title.- Parameters:
title- may not benull- Returns:
- null when not found.
- Throws:
IOException- when lookup fails.
-
getMyPlaylists
com.google.api.services.youtube.model.PlaylistListResponse getMyPlaylists(String pageToken, long maxResults) throws IOException Page through all YouTube playlists of predefined channel.- Parameters:
pageToken- identifies a page in result-set.maxResults- limit on number of results.- Returns:
- zero or more
Playlist - Throws:
IOException- when lookup fails.
-
getPlaylistItems
com.google.api.services.youtube.model.PlaylistItemListResponse getPlaylistItems(String playlistId, String pageToken, long maxResults) throws IOException Find YouTube playlist by id.- Parameters:
playlistId- may not benullpageToken- may not benullmaxResults- may not benull- Returns:
- will not be
null - Throws:
IOException- when lookup fails.
-
addVideoToMyChannel
com.google.api.services.youtube.model.Video addVideoToMyChannel(VideoUpload videoUpload) throws IOException Upload a video to predefined YouTube channel.- Parameters:
videoUpload- may not benull- Returns:
- YouTube object with non-null id.
- Throws:
IOException- when transaction fails.
-
addPlaylistItem
com.google.api.services.youtube.model.PlaylistItem addPlaylistItem(String playlistId, String videoId) throws IOException Add a previously uploaded video to specified YouTube playlist.- Parameters:
playlistId- may not benullvideoId- may not benull- Returns:
- YouTube object which describes mapping, with non-null id.
- Throws:
IOException
-
createPlaylist
com.google.api.services.youtube.model.Playlist createPlaylist(String title, String description, String... tags) throws IOException Creates YouTube Playlist and adds it to the authorized account.- Parameters:
title- may not benulldescription- may not benulltags- zero or more tags to be applied to playlist on YouTube.- Throws:
IOException
-
removeMyVideo
Remove a previously uploaded video from YouTube.- Parameters:
videoId- may not benull- Throws:
Exception- when transaction fails.
-
removeVideoFromPlaylist
Remove a previously uploaded video from specified YouTube playlist.- Parameters:
playlistId- may not benullvideoId- may not benull- Throws:
IOException- when transaction fails.
-
removeMyPlaylist
Remove a previously created YouTube playlist.- Parameters:
playlistId- may not benull- Throws:
IOException- when transaction fails.
-