com.google.android.youtube.player.YouTubeThumbnailLoader |
A YouTubeThumbnailLoader
provides methods for loading YouTube thumbnails into a
YouTubeThumbnailView
. Get an instance of this class by calling
initialize
on a YouTubeThumbnailView
.
Video and playlist IDs required by setVideo(String)
and setPlaylist(String)
methods are provided by the YouTube Data API. To learn more about this API, visit https://developers.google.com/youtube/v3/.
Note that you must call release()
when you are finished
with the YouTubeThumbnailLoader
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
YouTubeThumbnailLoader.ErrorReason | Describes the reasons for an error in a YouTubeThumbnailView . |
||||||||||
YouTubeThumbnailLoader.OnThumbnailLoadedListener | Interface definition for a listener that is invoked when a thumbnail has been loaded. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Show the thumbnail of the first video in the playlist.
| |||||||||||
Determines whether the currently loaded playlist has a next video.
| |||||||||||
Determines whether the currently loaded playlist has a previous video.
| |||||||||||
Show the thumbnail of the next video in the playlist.
| |||||||||||
Show the thumbnail of the previous video in the playlist.
| |||||||||||
Releases system resources used by this
YouTubeThumbnailLoader . | |||||||||||
Set a
YouTubeThumbnailLoader.OnThumbnailLoadedListener which is invoked whenever a new
thumbnail has finished loading and has been displayed in this YouTube thumbnail view. | |||||||||||
Set this view to show thumbnail images for the given YouTube playlist ID, initially showing
the thumbnail for the video at the index specified in the
skipTo parameter. | |||||||||||
Set this view to show thumbnail images for the given YouTube playlist ID, initially showing
the thumbnail for the first video in the playlist.
| |||||||||||
Set this view to show the thumbnail image for the given YouTube video ID.
|
Show the thumbnail of the first video in the playlist.
Determines whether the currently loaded playlist has a next video.
true
if there is a next video in the playlist; otherwise returns false
.
Determines whether the currently loaded playlist has a previous video.
true
if there is a previous video in the playlist; otherwise returns
false
.
Show the thumbnail of the next video in the playlist.
Note that a second call to next()
or previous()
, before the first call
has finished (as indicated by
onThumbnailLoaded(YouTubeThumbnailView, String)
), might be
ignored.
NoSuchElementException | This exception is thrown if the method is called at the end of the playlist. |
---|
Show the thumbnail of the previous video in the playlist.
Note that a second call to next()
or previous()
, before the first call
has finished (as indicated by
onThumbnailLoaded(YouTubeThumbnailView, String)
), might be
ignored.
NoSuchElementException | This exception is thrown if the method is called at the start of the playlist. |
---|
Releases system resources used by this YouTubeThumbnailLoader
.
Note that after calling this method any further interaction with this
YouTubeThumbnailLoader
is forbidden. A new instance must be created to load thumbnails
into a YouTubeThumbnailView
.
Set a YouTubeThumbnailLoader.OnThumbnailLoadedListener
which is invoked whenever a new
thumbnail has finished loading and has been displayed in this YouTube thumbnail view.
listener | The listener to register. |
---|
Set this view to show thumbnail images for the given YouTube playlist ID, initially showing
the thumbnail for the video at the index specified in the skipTo
parameter.
playlistId | The ID for the playlist to show thumbnail images from, as returned from the YouTube Data API. |
---|---|
skipTo | The video in the playlist to skip to. |
Set this view to show thumbnail images for the given YouTube playlist ID, initially showing the thumbnail for the first video in the playlist.
playlistId | The ID of the playlist to show thumbnail images from, as returned from the YouTube Data API. |
---|
Set this view to show the thumbnail image for the given YouTube video ID.
videoId | The ID of the video for which the thumbnail image is being shown, as returned from the YouTube Data API. |
---|