Class YouTubeAPIVersion3ServiceImpl
java.lang.Object
org.opencastproject.publication.youtube.YouTubeAPIVersion3ServiceImpl
- All Implemented Interfaces:
YouTubeAPIVersion3Service
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opencastproject.publication.youtube.YouTubeAPIVersion3Service
YouTubeAPIVersion3Service.PrivacyStatus -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.api.services.youtube.model.CaptionaddCaptions(String videoId, File file, String language, String name) Add captions to a video.com.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, YouTubeAPIVersion3Service.PrivacyStatus privacyStatus, 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.voidsetThumbnail(String videoId, File thumbnail, String mimeType) Set a thumbnail for a video.
-
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.
-
setThumbnail
Description copied from interface:YouTubeAPIVersion3ServiceSet a thumbnail for a video.- Specified by:
setThumbnailin interfaceYouTubeAPIVersion3Service- Parameters:
videoId- the video idthumbnail- the thumbnail filemimeType- the thumbnail mime type- Throws:
IOException- when transaction fails.
-
createPlaylist
public com.google.api.services.youtube.model.Playlist createPlaylist(String title, String description, YouTubeAPIVersion3Service.PrivacyStatus privacyStatus, 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 benullprivacyStatus- 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.
-
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.
-
addCaptions
public com.google.api.services.youtube.model.Caption addCaptions(String videoId, File file, String language, String name) throws IOException Description copied from interface:YouTubeAPIVersion3ServiceAdd captions to a video.- Specified by:
addCaptionsin interfaceYouTubeAPIVersion3Service- Parameters:
videoId- the video idfile- the caption filelanguage- the language of the captionsname- the name of the captions- Returns:
- the created caption object
- Throws:
IOException- when transaction fails.
-