Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る


abstract class ControllerCallback
   ↳ androidx.media2.session.MediaController.ControllerCallback

Interface for listening to change in activeness of the MediaSession. It's active if and only if it has set a player.


Public constructors

Interface for listening to change in activeness of the MediaSession.

Public methods
open Unit
onAllowedCommandsChanged(@NonNull controller: MediaController, @NonNull commands: SessionCommandGroup)

Called when the allowed commands are changed by session.

open Unit
onBufferingStateChanged(@NonNull controller: MediaController, @NonNull item: MediaItem, state: Int)

Called to report buffering events for a media item.

open Unit
onConnected(@NonNull controller: MediaController, @NonNull allowedCommands: SessionCommandGroup)

Called when the controller is successfully connected to the session.

open Unit
onCurrentMediaItemChanged(@NonNull controller: MediaController, @Nullable item: MediaItem?)

Called when the current item is changed.

open SessionResult
onCustomCommand(@NonNull controller: MediaController, @NonNull command: SessionCommand, @Nullable args: Bundle?)

Called when the session sent a custom command.

open Unit
onDisconnected(@NonNull controller: MediaController)

Called when the session refuses the controller or the controller is disconnected from the session.

open Unit
onPlaybackCompleted(@NonNull controller: MediaController)

Called when the playback is completed.

open Unit

Called when the session has changed anything related with the PlaybackInfo.

open Unit
onPlaybackSpeedChanged(@NonNull controller: MediaController, speed: Float)

Called when playback speed is changed.

open Unit
onPlayerStateChanged(@NonNull controller: MediaController, state: Int)

Called when the player state is changed.

open Unit
onPlaylistChanged(@NonNull controller: MediaController, @Nullable list: MutableList<MediaItem!>?, @Nullable metadata: MediaMetadata?)

Called when a playlist is changed.

open Unit
onPlaylistMetadataChanged(@NonNull controller: MediaController, @Nullable metadata: MediaMetadata?)

Called when a playlist metadata is changed.

open Unit
onRepeatModeChanged(@NonNull controller: MediaController, repeatMode: Int)

Called when the repeat mode is changed.

open Unit
onSeekCompleted(@NonNull controller: MediaController, position: