Google is committed to advancing racial equity for Black communities. See how.

PlayerCallback

abstract class PlayerCallback : SessionPlayer.PlayerCallback
kotlin.Any
   ↳ androidx.media2.common.SessionPlayer.PlayerCallback
   ↳ androidx.media2.player.MediaPlayer.PlayerCallback

Interface definition for callbacks to be invoked when the player has the corresponding events.

Summary

Public constructors

Interface definition for callbacks to be invoked when the player has the corresponding events.

Public methods
open Unit
onError(@NonNull mp: MediaPlayer, @NonNull item: MediaItem, what: Int, extra: Int)

Called to indicate an error.

open Unit
onInfo(@NonNull mp: MediaPlayer, @NonNull item: MediaItem, what: Int, extra: Int)

Called to indicate an info or a warning.

open Unit
onMediaTimeDiscontinuity(@NonNull mp: MediaPlayer, @NonNull item: MediaItem, @NonNull timestamp: MediaTimestamp)

Called when a discontinuity in the normal progression of the media time is detected.

open Unit
onTimedMetaDataAvailable(@NonNull mp: MediaPlayer, @NonNull item: MediaItem, @NonNull data: TimedMetaData)

Called to indicate available timed metadata

open Unit
onVideoSizeChanged(@NonNull mp: MediaPlayer, @NonNull item: MediaItem, @NonNull size: VideoSize)

open Unit
onVideoSizeChanged(@NonNull player: SessionPlayer, @NonNull size: VideoSize)

Called to indicate the video size

Inherited functions

Public constructors

<init>

PlayerCallback()

Interface definition for callbacks to be invoked when the player has the corresponding events.