public final class

MediaControllerCompat.PlaybackInfo

extends java.lang.Object

 java.lang.Object

↳androidx.media3.session.legacy.MediaControllerCompat.PlaybackInfo

Overview

Holds information about the way volume is handled for this session.

Summary

Fields
public static final intPLAYBACK_TYPE_LOCAL

The session uses local playback.

public static final intPLAYBACK_TYPE_REMOTE

The session uses remote playback.

Methods
public AudioAttributesCompatgetAudioAttributes()

Get the audio attributes for this session.

public intgetAudioStream()

Gets the stream this is currently controlling volume on.

public intgetCurrentVolume()

Gets the current volume for this session.

public intgetMaxVolume()

Gets the maximum volume that may be set for this session.

public intgetPlaybackType()

Gets the type of volume handling, either local or remote.

public intgetVolumeControl()

Gets the type of volume control that can be used.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final int PLAYBACK_TYPE_LOCAL

The session uses local playback.

public static final int PLAYBACK_TYPE_REMOTE

The session uses remote playback.

Methods

public int getPlaybackType()

Gets the type of volume handling, either local or remote. One of:

Returns:

The type of volume handling this session is using.

public int getAudioStream()

Deprecated: Use MediaControllerCompat.PlaybackInfo.getAudioAttributes() instead.

Gets the stream this is currently controlling volume on. When the volume type is MediaControllerCompat.PlaybackInfo.PLAYBACK_TYPE_REMOTE this value does not have meaning and should be ignored.

Returns:

The stream this session is playing on.

public AudioAttributesCompat getAudioAttributes()

Get the audio attributes for this session. The attributes will affect volume handling for the session. When the volume type is MediaControllerCompat.PlaybackInfo.PLAYBACK_TYPE_REMOTE these may be ignored by the remote volume handler.

Returns:

The attributes for this session.

public int getVolumeControl()

Gets the type of volume control that can be used. One of:

Returns:

The type of volume control that may be used with this session.

public int getMaxVolume()

Gets the maximum volume that may be set for this session.

Returns:

The maximum allowed volume where this session is playing.

public int getCurrentVolume()

Gets the current volume for this session.

Returns:

The current volume where this session is playing.