Skip to content

Most visited

Recently visited

navigation
added in version 26.1.0
belongs to Maven artifact com.android.support:leanback-v17:27.0.0

PlayerAdapter.Callback

public static class PlayerAdapter.Callback
extends Object

java.lang.Object
   ↳ android.support.v17.leanback.media.PlayerAdapter.Callback


Client for client of PlayerAdapter.

Summary

Public constructors

PlayerAdapter.Callback()

Public methods

void onBufferedPositionChanged(PlayerAdapter adapter)

Event for getBufferedPosition() changed.

void onBufferingStateChanged(PlayerAdapter adapter, boolean start)

Event for buffering start or stop.

void onCurrentPositionChanged(PlayerAdapter adapter)

Event for getCurrentPosition() changed.

void onDurationChanged(PlayerAdapter adapter)

Event for getDuration() changed.

void onError(PlayerAdapter adapter, int errorCode, String errorMessage)

Event for error.

void onMetadataChanged(PlayerAdapter adapter)

Event for meta data changed.

void onPlayCompleted(PlayerAdapter adapter)

Client when the current media is finished.

void onPlayStateChanged(PlayerAdapter adapter)

Client for Play/Pause state change.

void onPreparedStateChanged(PlayerAdapter adapter)

Client for isPrepared() changed.

void onVideoSizeChanged(PlayerAdapter adapter, int width, int height)

Event for video size changed.

Inherited methods

From class java.lang.Object

Public constructors

PlayerAdapter.Callback

added in version 26.1.0
PlayerAdapter.Callback ()

Public methods

onBufferedPositionChanged

added in version 26.1.0
void onBufferedPositionChanged (PlayerAdapter adapter)

Event for getBufferedPosition() changed.

Parameters
adapter PlayerAdapter: The adapter whose getBufferedPosition() changed.

onBufferingStateChanged

added in version 26.1.0
void onBufferingStateChanged (PlayerAdapter adapter, 
                boolean start)

Event for buffering start or stop. Initial default value is false.

Parameters
adapter PlayerAdapter: The adapter that begins buffering or finishes buffering.

start boolean: True for buffering start, false otherwise.

onCurrentPositionChanged

added in version 26.1.0
void onCurrentPositionChanged (PlayerAdapter adapter)

Event for getCurrentPosition() changed.

Parameters
adapter PlayerAdapter: The adapter whose getCurrentPosition() changed.

onDurationChanged

added in version 26.1.0
void onDurationChanged (PlayerAdapter adapter)

Event for getDuration() changed. Usually the duration does not change after playing except for live stream.

Parameters
adapter PlayerAdapter: The adapter whose getDuration() changed.

onError

added in version 26.1.0
void onError (PlayerAdapter adapter, 
                int errorCode, 
                String errorMessage)

Event for error.

Parameters
adapter PlayerAdapter: The adapter that encounters error.

errorCode int: Optional error code, specific to implementation.

errorMessage String: Optional error message, specific to implementation.

onMetadataChanged

added in version 27.0.0
void onMetadataChanged (PlayerAdapter adapter)

Event for meta data changed.

Parameters
adapter PlayerAdapter: The adapter that finishes current media item.

onPlayCompleted

added in version 26.1.0
void onPlayCompleted (PlayerAdapter adapter)

Client when the current media is finished.

Parameters
adapter PlayerAdapter: The adapter that has just finished current media.

onPlayStateChanged

added in version 26.1.0
void onPlayStateChanged (PlayerAdapter adapter)

Client for Play/Pause state change. See isPlaying().

Parameters
adapter PlayerAdapter

onPreparedStateChanged

added in version 26.1.0
void onPreparedStateChanged (PlayerAdapter adapter)

Client for isPrepared() changed.

Parameters
adapter PlayerAdapter: The adapter that has changed ready state.

onVideoSizeChanged

added in version 26.1.0
void onVideoSizeChanged (PlayerAdapter adapter, 
                int width, 
                int height)

Event for video size changed.

Parameters
adapter PlayerAdapter: The adapter whose video size has been detected or changed.

width int: Intrinsic width of the video.

height int: Intrinsic height of the video.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)