public class

PlayerAdapter.Callback

extends java.lang.Object

 java.lang.Object

↳androidx.leanback.media.PlayerAdapter.Callback

Overview

Client for client of PlayerAdapter.

Summary

Constructors
publicCallback()

Methods
public voidonBufferedPositionChanged(PlayerAdapter adapter)

Event for PlayerAdapter.getBufferedPosition() changed.

public voidonBufferingStateChanged(PlayerAdapter adapter, boolean start)

Event for buffering start or stop.

public voidonCurrentPositionChanged(PlayerAdapter adapter)

Event for PlayerAdapter.getCurrentPosition() changed.

public voidonDurationChanged(PlayerAdapter adapter)

Event for PlayerAdapter.getDuration() changed.

public voidonError(PlayerAdapter adapter, int errorCode, java.lang.String errorMessage)

Event for error.

public voidonMetadataChanged(PlayerAdapter adapter)

Event for meta data changed.

public voidonPlayCompleted(PlayerAdapter adapter)

Client when the current media is finished.

public voidonPlayStateChanged(PlayerAdapter adapter)

Client for Play/Pause state change.

public voidonPreparedStateChanged(PlayerAdapter adapter)

Client for PlayerAdapter.isPrepared() changed.

public voidonVideoSizeChanged(PlayerAdapter adapter, int width, int height)

Event for video size changed.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Callback()

Methods

public void onPlayStateChanged(PlayerAdapter adapter)

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

public void onPreparedStateChanged(PlayerAdapter adapter)

Client for PlayerAdapter.isPrepared() changed.

Parameters:

adapter: The adapter that has changed ready state.

public void onPlayCompleted(PlayerAdapter adapter)

Client when the current media is finished.

Parameters:

adapter: The adapter that has just finished current media.

public void onCurrentPositionChanged(PlayerAdapter adapter)

Event for PlayerAdapter.getCurrentPosition() changed.

Parameters:

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

public void onBufferedPositionChanged(PlayerAdapter adapter)

Event for PlayerAdapter.getBufferedPosition() changed.

Parameters:

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

public void onDurationChanged(PlayerAdapter adapter)

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

Parameters:

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

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

Event for video size changed.

Parameters:

adapter: The adapter whose video size has been detected or changed.
width: Intrinsic width of the video.
height: Intrinsic height of the video.

public void onError(PlayerAdapter adapter, int errorCode, java.lang.String errorMessage)

Event for error.

Parameters:

adapter: The adapter that encounters error.
errorCode: Optional error code, specific to implementation.
errorMessage: Optional error message, specific to implementation.

public void onBufferingStateChanged(PlayerAdapter adapter, boolean start)

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

Parameters:

adapter: The adapter that begins buffering or finishes buffering.
start: True for buffering start, false otherwise.

public void onMetadataChanged(PlayerAdapter adapter)

Event for meta data changed.

Parameters:

adapter: The adapter that finishes current media item.