YouTube

YouTubePlayer.PlayerStateChangeListener

public static interface
YouTubePlayer.PlayerStateChangeListener
com.google.android.youtube.player.YouTubePlayer.PlayerStateChangeListener

Overview

Interface definition for callbacks which are invoked when the high level player state changes.

Summary

Public methods
abstract void onAdStarted()
Called when playback of an advertisement starts.
abstract void onError(YouTubePlayer.ErrorReason reason)
Called when an error occurs.
abstract void onLoaded(String videoId)
Called when a video has finished loading.
abstract void onLoading()
Called when the player begins loading a video and is not ready to accept commands affecting playback (such as play() or pause()).
abstract void onVideoEnded()
Called when the video reaches its end.
abstract void onVideoStarted()
Called when playback of the video starts.

Public methods

public abstract void onAdStarted ()

Called when playback of an advertisement starts.

public abstract void onError (YouTubePlayer.ErrorReason reason)

Called when an error occurs. This can be called from any state.

Parameters
reason The reason for the error.

public abstract void onLoaded (String videoId)

Called when a video has finished loading.

Playback methods such as play(), pause() or seekToMillis(int) may be called after this callback.

If the video was loaded through one of the load functions such as loadVideo(String) this callback will typically be followed by a call to either onAdStarted() or onVideoStarted().

Parameters
videoId The YouTube video id of the loaded video.

public abstract void onLoading ()

Called when the player begins loading a video and is not ready to accept commands affecting playback (such as play() or pause()).

public abstract void onVideoEnded ()

Called when the video reaches its end.

public abstract void onVideoStarted ()

Called when playback of the video starts.

Authentication required

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

Signing you in...

Google Developers needs your permission to do that.