The YouTube Android Player API is an experimental API version, which means it is still in development, though we do not expect major interface changes. Until the experimental label is removed, the Deprecation Policy for YouTube APIs won't apply to this version as discussed in the API Terms of Service.
public static interface
YouTubePlayer.PlaybackEventListener
YouTubePlayer.PlaybackEventListener
com.google.android.youtube.player.YouTubePlayer.PlaybackEventListener |
Overview
Interface definition for callbacks which are invoked when video playback events occur.
Summary
Public methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called when buffering starts or ends.
| |||||||||||
Called when playback is paused, either due to
pause() or user action. | |||||||||||
Called when playback starts, either due to
play() or user action. | |||||||||||
Called when a jump in playback position occurs, either due to the user scrubbing or a seek
method being called (e.g.
| |||||||||||
Called when playback stops for a reason other than being paused, e.g.
|
Public methods
public abstract void onBuffering (boolean isBuffering)
Called when buffering starts or ends. Note, this may occur either before or after
onPlaying()
when a video starts loading.
Parameters
isBuffering | true if the player is buffering, false otherwise.
|
public abstract void onPaused ()
Called when playback is paused, either due to pause()
or user action.
public abstract void onSeekTo (int newPositionMillis)
Called when a jump in playback position occurs, either due to the user scrubbing or a seek
method being called (e.g. seekToMillis(int)
).
Parameters
newPositionMillis | The time in milliseconds to which the player has seeked. |
public abstract void onStopped ()
Called when playback stops for a reason other than being paused, e.g. the video ending or a playback error.