Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

PlayerCallback

open class PlayerCallback
kotlin.Any
   ↳ androidx.leanback.media.PlaybackGlueHost.PlayerCallback

Optional Client that implemented by PlaybackGlueHost to respond to player event.

Summary

Public constructors

Optional Client that implemented by PlaybackGlueHost to respond to player event.

Public methods
open Unit
onVideoSizeChanged(videoWidth: Int, videoHeight: Int)

Size of the video changes, the Host should adjust SurfaceView's layout width and height.

open Unit

notify media starts/stops buffering/preparing.

open Unit
onError(errorCode: Int, errorMessage: CharSequence!)

notify media has error.

Public constructors

<init>

PlayerCallback()

Optional Client that implemented by PlaybackGlueHost to respond to player event.

Public methods

onVideoSizeChanged

open fun onVideoSizeChanged(videoWidth: Int, videoHeight: Int): Unit

Size of the video changes, the Host should adjust SurfaceView's layout width and height.

Parameters
videoWidth Int:
videoHeight Int:

onBufferingStateChanged

open fun onBufferingStateChanged(start: Boolean): Unit

notify media starts/stops buffering/preparing. The Host could start or stop progress bar.

Parameters
start Boolean: True for buffering start, false otherwise.

onError

open fun onError(errorCode: Int, errorMessage: CharSequence!): Unit

notify media has error. The Host could show error dialog.

Parameters
errorCode Int: Optional error code for specific implementation.
errorMessage Int: Optional error message for specific implementation.