Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

PlaybackInfo

class PlaybackInfo : VersionedParcelable
kotlin.Any
   ↳ androidx.media2.MediaController2.PlaybackInfo

Holds information about the 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
Int

Get the type of volume control that can be used.

Int

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

AudioAttributesCompat!

Get the audio attributes for this session.

Int

Get the current volume for this session.

Int

Get the type of playback which affects volume handling.

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

getControlType

fun getControlType(): Int

Get 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.

getMaxVolume

fun getMaxVolume(): Int

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

This is only meaningful when the playback type is PLAYBACK_TYPE_REMOTE.

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

getAudioAttributes

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.

Return
AudioAttributesCompat!: The attributes for this session.

getCurrentVolume

fun getCurrentVolume(): Int

Get the current volume for this session.

This is only meaningful when the playback type is PLAYBACK_TYPE_REMOTE.

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

getPlaybackType

fun getPlaybackType(): Int

Get the type of playback which affects volume handling. One of:

Return
Int: The type of playback this session is using.