Class YouTubeAPIVersion3ServiceImpl
java.lang.Object
org.opencastproject.publication.youtube.YouTubeAPIVersion3ServiceImpl
- All Implemented Interfaces:
YouTubeAPIVersion3Service
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
YouTubeAPIVersion3ServiceImpl
public YouTubeAPIVersion3ServiceImpl()
-
-
Method Details
-
initialize
Description copied from interface:YouTubeAPIVersion3ServiceConfigure the underlyingYouTubeinstance.- Specified by:
initializein interfaceYouTubeAPIVersion3Service- Parameters:
credentials- may not benull- Throws:
IOException- when configuration files not found.
-
addVideoToMyChannel
public com.google.api.services.youtube.model.Video addVideoToMyChannel(VideoUpload videoUpload) throws IOException Description copied from interface:YouTubeAPIVersion3ServiceUpload a video to predefined YouTube channel.- Specified by:
addVideoToMyChannelin interfaceYouTubeAPIVersion3Service- Parameters:
videoUpload- may not benull- Returns:
- YouTube object with non-null id.
- Throws:
IOException- when transaction fails.
-
createPlaylist
public com.google.api.services.youtube.model.Playlist createPlaylist(String title, String description, String... tags) throws IOException Description copied from interface:YouTubeAPIVersion3ServiceCreates YouTube Playlist and adds it to the authorized account.- Specified by:
createPlaylistin interfaceYouTubeAPIVersion3Service- Parameters:
title- may not benulldescription- may not benulltags- zero or more tags to be applied to playlist on YouTube.- Throws:
IOException
-
addPlaylistItem
public com.google.api.services.youtube.model.PlaylistItem addPlaylistItem(String playlistId, String videoId) throws IOException Description copied from interface:YouTubeAPIVersion3ServiceAdd a previously uploaded video to specified YouTube playlist.- Specified by:
addPlaylistItemin interfaceYouTubeAPIVersion3Service- Parameters:
playlistId- may not benullvideoId- may not benull- Returns:
- YouTube object which describes mapping, with non-null id.
- Throws:
IOException
-
removeVideoFromPlaylist
Description copied from interface:YouTubeAPIVersion3ServiceRemove a previously uploaded video from specified YouTube playlist.- Specified by:
removeVideoFromPlaylistin interfaceYouTubeAPIVersion3Service- Parameters:
playlistId- may not benullvideoId- may not benull- Throws:
IOException- when transaction fails.
-
removeMyVideo
Description copied from interface:YouTubeAPIVersion3ServiceRemove a previously uploaded video from YouTube.- Specified by:
removeMyVideoin interfaceYouTubeAPIVersion3Service- Parameters:
videoId- may not benull- Throws:
Exception- when transaction fails.
-
removeMyPlaylist
Description copied from interface:YouTubeAPIVersion3ServiceRemove a previously created YouTube playlist.- Specified by:
removeMyPlaylistin interfaceYouTubeAPIVersion3Service- Parameters:
playlistId- may not benull- Throws:
IOException- when transaction fails.
-
searchMyVideos
public com.google.api.services.youtube.model.SearchListResponse searchMyVideos(String queryTerm, String pageToken, long maxResults) throws IOException Description copied from interface:YouTubeAPIVersion3ServiceSearch for videos on predefined channel.- Specified by:
searchMyVideosin interfaceYouTubeAPIVersion3Service- 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
Description copied from interface:YouTubeAPIVersion3ServiceGet video by id.- Specified by:
getVideoByIdin interfaceYouTubeAPIVersion3Service- Parameters:
videoId- may not benull- Returns:
- null when not found.
- Throws:
IOException
-
getMyPlaylistByTitle
public com.google.api.services.youtube.model.Playlist getMyPlaylistByTitle(String title) throws IOException Description copied from interface:YouTubeAPIVersion3ServiceGet playlist by title.- Specified by:
getMyPlaylistByTitlein interfaceYouTubeAPIVersion3Service- Parameters:
title- may not benull- Returns:
- null when not found.
- Throws:
IOException- when lookup fails.
-
getMyPlaylists
public com.google.api.services.youtube.model.PlaylistListResponse getMyPlaylists(String pageToken, long maxResults) throws IOException Description copied from interface:YouTubeAPIVersion3ServicePage through all YouTube playlists of predefined channel.- Specified by:
getMyPlaylistsin interfaceYouTubeAPIVersion3Service- 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
public com.google.api.services.youtube.model.PlaylistItemListResponse getPlaylistItems(String playlistId, String pageToken, long maxResults) throws IOException Description copied from interface:YouTubeAPIVersion3ServiceFind YouTube playlist by id.- Specified by:
getPlaylistItemsin interfaceYouTubeAPIVersion3Service- Parameters:
playlistId- may not benullpageToken- may not benullmaxResults- may not benull- Returns:
- will not be
null - Throws:
IOException- when lookup fails.
-