RemoteSessionPlayer.Callback

Added in 1.0.0
Deprecated in 1.3.0

class RemoteSessionPlayer.Callback : SessionPlayer.PlayerCallback


A callback class to receive notifications for events on the remote session player. See registerPlayerCallback to register this callback.

This is registered by MediaSession to notify volume changes to the .

Summary

Public constructors

Public functions

Unit

Called to indicate that the volume has changed.

Inherited functions

From androidx.media2.common.SessionPlayer.PlayerCallback
Unit
onAudioAttributesChanged(
    player: SessionPlayer,
    attributes: AudioAttributesCompat?
)

Called when the player's current audio attributes are changed.

Unit
onBufferingStateChanged(
    player: SessionPlayer,
    item: MediaItem?,
    buffState: Int
)

Called when a buffering events for a media item happened.

Unit

Called when the player's current media item has changed.

Unit

Called when the player finished playing.

Unit
onPlaybackSpeedChanged(player: SessionPlayer, playbackSpeed: Float)

Called when the playback speed has changed.

Unit
onPlayerStateChanged(player: SessionPlayer, playerState: Int)

Called when the state of the player has changed.

Unit
onPlaylistChanged(
    player: SessionPlayer,
    list: (Mutable)List<MediaItem!>?,
    metadata: MediaMetadata?
)

Called when a playlist is changed.

Unit

Called when a playlist metadata is changed.

Unit
onRepeatModeChanged(player: SessionPlayer, repeatMode: Int)

Called when the repeat mode is changed.

Unit
onSeekCompleted(player: SessionPlayer, position: Long)

Called when seekTo is completed.

Unit
onShuffleModeChanged(player: SessionPlayer, shuffleMode: Int)

Called when the shuffle mode is changed.

Unit
onSubtitleData(
    player: SessionPlayer,
    item: MediaItem,
    track: SessionPlayer.TrackInfo,
    data: SubtitleData
)

Called when the player's subtitle track has new subtitle data available.

Unit
onTrackDeselected(
    player: SessionPlayer,
    trackInfo: SessionPlayer.TrackInfo
)

Called when a track is deselected.

Unit
onTrackSelected(
    player: SessionPlayer,
    trackInfo: SessionPlayer.TrackInfo
)

Called when a track is selected.

Unit
onTracksChanged(
    player: SessionPlayer,
    tracks: (Mutable)List<SessionPlayer.TrackInfo!>
)

Called when the tracks of the current media item is changed such as 1) when tracks of a media item become available, 2) when new tracks are found during playback, or 3) when the current media item is changed.

Unit

Called to indicate the video size

Public constructors

Callback

Added in 1.0.0
Deprecated in 1.3.0
Callback()

Public functions

onVolumeChanged

Added in 1.0.0
Deprecated in 1.3.0
fun onVolumeChanged(player: RemoteSessionPlayer, volume: Int): Unit

Called to indicate that the volume has changed.

Parameters
player: RemoteSessionPlayer

the player that has changed volume.

volume: Int

the new volume

See also
setVolume