YouTubePlayer.PlayerStateChangeListener
com.google.android.youtube.player.YouTubePlayer.PlayerStateChangeListener |
Overview
Interface definition for callbacks that are invoked when the high-level player state changes.
Summary
Public methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called when playback of an advertisement starts.
| |||||||||||
Called when an error occurs.
| |||||||||||
Called when a video has finished loading.
| |||||||||||
Called when the video reaches its end.
| |||||||||||
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 ()
public abstract void onVideoEnded ()
Called when the video reaches its end.
public abstract void onVideoStarted ()
Called when playback of the video starts.