# MediaControllerCompat.PlaybackInfo

Artifact: [androidx.media:media](https://developer.android.com/jetpack/androidx/releases/media) [View Source](https://cs.android.com/search?q=file:android/support/v4/media/session/MediaControllerCompat.java+class:android.support.v4.media.session.MediaControllerCompat.PlaybackInfo) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

*** ** * ** ***


```
public final class MediaControllerCompat.PlaybackInfo
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> androidx.media is deprecated. Please migrate to [androidx.media3](https://developer.android.com/media/media3).

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

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#PLAYBACK_TYPE_LOCAL() = 1` **This field is deprecated.** Deprecated in Java |
| `static final int` | `https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#PLAYBACK_TYPE_REMOTE() = 2` **This field is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/media/AudioAttributesCompat` | `[getAudioAttributes](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getAudioAttributes())()` **This method is deprecated.** Deprecated in Java |
| `int` | `[getAudioStream](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getAudioStream())()` **This method is deprecated.** Use `https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getAudioAttributes()` instead. <br /> |
| `int` | `[getCurrentVolume](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getCurrentVolume())()` **This method is deprecated.** Deprecated in Java |
| `int` | `[getMaxVolume](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getMaxVolume())()` **This method is deprecated.** Deprecated in Java |
| `int` | `[getPlaybackType](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getPlaybackType())()` **This method is deprecated.** Deprecated in Java |
| `int` | `[getVolumeControl](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getVolumeControl())()` **This method is deprecated.** Deprecated in Java |

## Constants

### PLAYBACK_TYPE_LOCAL

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public static final int PLAYBACK_TYPE_LOCAL = 1
```

> [!CAUTION]
> **This field is deprecated.**   
> Deprecated in Java

The session uses local playback.

### PLAYBACK_TYPE_REMOTE

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public static final int PLAYBACK_TYPE_REMOTE = 2
```

> [!CAUTION]
> **This field is deprecated.**   
> Deprecated in Java

The session uses remote playback.

## Public methods

### getAudioAttributes

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public @NonNull AudioAttributesCompat [getAudioAttributes](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getAudioAttributes())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Get the audio attributes for this session. The attributes will affect volume handling for the session. When the volume type is `https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#PLAYBACK_TYPE_REMOTE()` these may be ignored by the remote volume handler.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/media/AudioAttributesCompat` | The attributes for this session. |

### getAudioStream

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0)

```
public int [getAudioStream](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getAudioStream())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getAudioAttributes()` instead.

Gets the stream this is currently controlling volume on. When the volume type is `https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#PLAYBACK_TYPE_REMOTE()` this value does not have meaning and should be ignored.

| Returns |
|---|---|
| `int` | The stream this session is playing on. |

### getCurrentVolume

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public int [getCurrentVolume](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getCurrentVolume())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the current volume for this session.

| Returns |
|---|---|
| `int` | The current volume where this session is playing. |

### getMaxVolume

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public int [getMaxVolume](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getMaxVolume())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

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

| Returns |
|---|---|
| `int` | The maximum allowed volume where this session is playing. |

### getPlaybackType

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public int [getPlaybackType](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getPlaybackType())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

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

- `https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#PLAYBACK_TYPE_LOCAL()`
- `https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#PLAYBACK_TYPE_REMOTE()`

| Returns |
|---|---|
| `int` | The type of volume handling this session is using. |

### getVolumeControl

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public int [getVolumeControl](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getVolumeControl())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

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

- `https://developer.android.com/reference/androidx/media/VolumeProviderCompat#VOLUME_CONTROL_ABSOLUTE()`
- `https://developer.android.com/reference/androidx/media/VolumeProviderCompat#VOLUME_CONTROL_RELATIVE()`
- `https://developer.android.com/reference/androidx/media/VolumeProviderCompat#VOLUME_CONTROL_FIXED()`

| Returns |
|---|---|
| `int` | The type of volume control that may be used with this session. |