MediaControllerCompat.PlaybackInfo


class MediaControllerCompat.PlaybackInfo


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

Summary

Constants

const Int

The session uses local playback.

const Int

The session uses remote playback.

Public functions

AudioAttributesCompat

Get the audio attributes for this session.

Int

This function is deprecated.

Use getAudioAttributes instead.

Int

Gets the current volume for this session.

Int

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

Int

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

Int

Gets the type of volume control that can be used.

Constants

PLAYBACK_TYPE_LOCAL

Added in 1.1.0
const val PLAYBACK_TYPE_LOCAL = 1: Int

The session uses local playback.

PLAYBACK_TYPE_REMOTE

Added in 1.1.0
const val PLAYBACK_TYPE_REMOTE = 2: Int

The session uses remote playback.

Public functions

getAudioAttributes

Added in 1.1.0
fun getAudioAttributes(): AudioAttributesCompat

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

Returns
AudioAttributesCompat

The attributes for this session.

getAudioStream

Added in 1.1.0
Deprecated in 1.1.0
fun getAudioStream(): Int

Gets the stream this is currently controlling volume on. When the volume type is 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
fun getCurrentVolume(): Int

Gets the current volume for this session.

Returns
Int

The current volume where this session is playing.

getMaxVolume

Added in 1.1.0
fun getMaxVolume(): Int

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
fun getPlaybackType(): Int

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

Returns
Int

The type of volume handling this session is using.

getVolumeControl

Added in 1.1.0
fun getVolumeControl(): Int

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

Returns
Int

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