Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

PlaybackInfo

class PlaybackInfo
kotlin.Any
   ↳ android.support.v4.media.session.MediaControllerCompat.PlaybackInfo

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

Summary

Constants

static Int

The session uses local playback.

static Int

The session uses remote playback.

Public methods

AudioAttributesCompat

Get the audio attributes for this session.

Int

Gets the stream this is currently controlling volume on.

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

static val PLAYBACK_TYPE_LOCAL: Int

The session uses local playback.

Value: 1

PLAYBACK_TYPE_REMOTE

static val PLAYBACK_TYPE_REMOTE: Int

The session uses remote playback.

Value: 2

Public methods

getAudioAttributes

@NonNull fun getAudioAttributes(): AudioAttributesCompat

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

Return
AudioAttributesCompat: The attributes for this session.

getAudioStream

fun getAudioStream(): Int

Deprecated: Use PlaybackInfo#getAudioAttributes() instead.

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

Return
Int: The stream this session is playing on.

getCurrentVolume

fun getCurrentVolume(): Int

Gets the current volume for this session.

Return
Int: The current volume where this session is playing.

getMaxVolume

fun getMaxVolume(): Int

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

Return
Int: The maximum allowed volume where this session is playing.

getPlaybackType

fun getPlaybackType(): Int

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

Return
Int: The type of volume handling this session is using.

getVolumeControl

fun getVolumeControl(): Int

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

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