YouTube

YouTubeThumbnailLoader

public interface
YouTubeThumbnailLoader
com.google.android.youtube.player.YouTubeThumbnailLoader

Overview

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/.

Summary

Nested Classes
enum YouTubeThumbnailLoader.ErrorReason Describes the reasons for an error in a YouTubeThumbnailView
interface YouTubeThumbnailLoader.OnThumbnailLoadedListener Interface definition for a listener that is invoked when a thumbnail has been loaded. 
Public methods
abstract void first()
Show the thumbnail of the first video in the playlist.
abstract boolean hasNext()
Determines whether the currently loaded playlist has a next video.
abstract boolean hasPrevious()
Determines whether the currently loaded playlist has a previous video.
abstract void next()
Show the thumbnail of the next video in the playlist.
abstract void previous()
Show the thumbnail of the previous video in the playlist.
abstract void release()
Releases system resources used by this YouTubeThumbnailLoader.
abstract void setOnThumbnailLoadedListener(YouTubeThumbnailLoader.OnThumbnailLoadedListener listener)
Set a YouTubeThumbnailLoader.OnThumbnailLoadedListener which is invoked whenever a new thumbnail has finished loading and has been displayed in this YouTube thumbnail view.
abstract void setPlaylist(String playlistId)
Set this view to show thumbnail images for the given YouTube playlist id.
abstract void setPlaylist(String playlistId, int skipTo)
Set this view to show thumbnail images for the given YouTube playlist id, initially showing the thumbnail for the video at the playlist index specified in the skipTo parameter.
abstract void setVideo(String videoId)
Set this view to show the thumbnail image for the given YouTube video id.

Public methods

public abstract void first ()

Show the thumbnail of the first video in the playlist.

public abstract boolean hasNext ()

Determines whether the currently loaded playlist has a next video.

Returns
  • true if there is a next video in the playlist; otherwise returns false.

public abstract boolean hasPrevious ()

Determines whether the currently loaded playlist has a previous video.

Returns
  • true if there is a previous video in the playlist; otherwise returns false.

public abstract void next ()

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.

Throws
NoSuchElementException This exception is thrown if the method is called at the end of the playlist.

public abstract void previous ()

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.

Throws
NoSuchElementException This exception is thrown if the method is called at the start of the playlist.

public abstract void release ()

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.

public abstract void setOnThumbnailLoadedListener (YouTubeThumbnailLoader.OnThumbnailLoadedListener listener)

Set a YouTubeThumbnailLoader.OnThumbnailLoadedListener which is invoked whenever a new thumbnail has finished loading and has been displayed in this YouTube thumbnail view.

Parameters
listener The listener to register.

public abstract void setPlaylist (String playlistId)

Set this view to show thumbnail images for the given YouTube playlist id. Will initially show the thumbnail for the first video in the playlist.

Parameters
playlistId The ID for the playlist to show thumbnail images from, as returned from the YouTube Data API.

public abstract void setPlaylist (String playlistId, int skipTo)

Set this view to show thumbnail images for the given YouTube playlist id, initially showing the thumbnail for the video at the playlist index specified in by the skipTo parameter.

Parameters
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.

public abstract void setVideo (String videoId)

Set this view to show the thumbnail image for the given YouTube video id.

Parameters
videoId The ID for the playlist to show thumbnail images from, as returned from the YouTube Data API.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.