PlayerAdapter.Callback


class PlayerAdapter.Callback


Client for client of PlayerAdapter.

Summary

Public constructors

Public functions

Unit

Event for getBufferedPosition changed.

Unit

Event for buffering start or stop.

Unit

Event for getCurrentPosition changed.

Unit

Event for getDuration changed.

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

Event for error.

Unit

Event for meta data changed.

Unit

Client when the current media is finished.

Unit

Client for Play/Pause state change.

Unit

Client for isPrepared changed.

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

Event for video size changed.

Public constructors

Callback

Added in 1.1.0
Callback()

Public functions

onBufferedPositionChanged

Added in 1.1.0
fun onBufferedPositionChanged(adapter: PlayerAdapter): Unit

Event for getBufferedPosition changed.

Parameters
adapter: PlayerAdapter

The adapter whose getBufferedPosition changed.

onBufferingStateChanged

Added in 1.1.0
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: Boolean

True for buffering start, false otherwise.

onCurrentPositionChanged

Added in 1.1.0
fun onCurrentPositionChanged(adapter: PlayerAdapter): Unit

Event for getCurrentPosition changed.

Parameters
adapter: PlayerAdapter

The adapter whose getCurrentPosition changed.

onDurationChanged

Added in 1.1.0
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

Added in 1.1.0
fun onError(adapter: PlayerAdapter, errorCode: Int, errorMessage: String?): Unit

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 1.1.0
fun onMetadataChanged(adapter: PlayerAdapter): Unit

Event for meta data changed.

Parameters
adapter: PlayerAdapter

The adapter that finishes current media item.

onPlayCompleted

Added in 1.1.0
fun onPlayCompleted(adapter: PlayerAdapter): Unit

Client when the current media is finished.

Parameters
adapter: PlayerAdapter

The adapter that has just finished current media.

onPlayStateChanged

Added in 1.1.0
fun onPlayStateChanged(adapter: PlayerAdapter): Unit

Client for Play/Pause state change. See isPlaying.

onPreparedStateChanged

Added in 1.1.0
fun onPreparedStateChanged(adapter: PlayerAdapter): Unit

Client for isPrepared changed.

Parameters
adapter: PlayerAdapter

The adapter that has changed ready state.

onVideoSizeChanged

Added in 1.1.0
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: Int

Intrinsic width of the video.

height: Int

Intrinsic height of the video.