Callback

open class Callback
kotlin.Any
   ↳ androidx.leanback.media.PlayerAdapter.Callback

Client for client of PlayerAdapter.

Summary

Public constructors

Client for client of PlayerAdapter.

Public methods

open Unit

Event for getBufferedPosition() changed.

open Unit

Event for buffering start or stop.

open Unit

Event for getCurrentPosition() changed.

open Unit

Event for getDuration() changed.

open Unit
onError(adapter: PlayerAdapter!, errorCode: Int, errorMessage: String!)

Event for error.

open Unit

Event for meta data changed.

open Unit

Client when the current media is finished.

open Unit

Client for Play/Pause state change.

open Unit

Client for isPrepared() changed.

open Unit
onVideoSizeChanged(adapter: PlayerAdapter!, width: Int, height: Int)

Event for video size changed.

Public constructors

<init>

Callback()

Client for client of PlayerAdapter.

Public methods

onBufferedPositionChanged

open fun onBufferedPositionChanged(adapter: PlayerAdapter!): Unit

Event for getBufferedPosition() changed.

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

onBufferingStateChanged

open fun onBufferingStateChanged(adapter: PlayerAdapter!, start: Boolean): Unit

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

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

onCurrentPositionChanged

open fun onCurrentPositionChanged(adapter: PlayerAdapter!): Unit

Event for getCurrentPosition() changed.

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

onDurationChanged

open fun onDurationChanged(adapter: PlayerAdapter!): Unit

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

open fun onError(adapter: PlayerAdapter!, errorCode: Int, errorMessage: String!): Unit

Event for error.

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

onMetadataChanged

open fun onMetadataChanged(adapter: PlayerAdapter!): Unit

Event for meta data changed.

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

onPlayCompleted

open fun onPlayCompleted(adapter: PlayerAdapter!): Unit

Client when the current media is finished.

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

onPlayStateChanged

open fun onPlayStateChanged(adapter: PlayerAdapter!): Unit

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

onPreparedStateChanged

open fun onPreparedStateChanged(adapter: PlayerAdapter!): Unit

Client for isPrepared() changed.

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

onVideoSizeChanged

open fun onVideoSizeChanged(adapter: PlayerAdapter!, width: Int, height: Int): Unit

Event for video size changed.

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