RemoteSessionPlayer.Callback

Added in 1.0.0
Deprecated in 1.3.0

public class RemoteSessionPlayer.Callback extends 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 methods

void

Called to indicate that the volume has changed.

Inherited methods

From androidx.media2.common.SessionPlayer.PlayerCallback
void

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

void
onBufferingStateChanged(
    @NonNull SessionPlayer player,
    @Nullable MediaItem item,
    int buffState
)

Called when a buffering events for a media item happened.

void

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

void

Called when the player finished playing.

void
onPlaybackSpeedChanged(
    @NonNull SessionPlayer player,
    float playbackSpeed
)

Called when the playback speed has changed.

void
onPlayerStateChanged(@NonNull SessionPlayer player, int playerState)

Called when the state of the player has changed.

void
onPlaylistChanged(
    @NonNull SessionPlayer player,
    @Nullable List<MediaItem> list,
    @Nullable MediaMetadata metadata
)

Called when a playlist is changed.

void

Called when a playlist metadata is changed.

void
onRepeatModeChanged(@NonNull SessionPlayer player, int repeatMode)

Called when the repeat mode is changed.

void
onSeekCompleted(@NonNull SessionPlayer player, long position)

Called when seekTo is completed.

void
onShuffleModeChanged(@NonNull SessionPlayer player, int shuffleMode)

Called when the shuffle mode is changed.

void
onSubtitleData(
    @NonNull SessionPlayer player,
    @NonNull MediaItem item,
    @NonNull SessionPlayer.TrackInfo track,
    @NonNull SubtitleData data
)

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

void

Called when a track is deselected.

void

Called when a track is selected.

void

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.

void

Called to indicate the video size

Public constructors

Callback

Added in 1.0.0
Deprecated in 1.3.0
public Callback()

Public methods

onVolumeChanged

Added in 1.0.0
Deprecated in 1.3.0
public void onVolumeChanged(@NonNull RemoteSessionPlayer player, int volume)

Called to indicate that the volume has changed.

Parameters
@NonNull RemoteSessionPlayer player

the player that has changed volume.

int volume

the new volume

See also
setVolume