PlaybackInfo
class PlaybackInfo : VersionedParcelable
kotlin.Any | |
↳ | androidx.media2.session.MediaController.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 | |
---|---|
Boolean | |
AudioAttributesCompat? |
Gets the audio attributes for this session. |
Int |
Gets the type of volume control that can be used. |
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 playback which affects volume handling. |
Int |
hashCode() |
Constants
PLAYBACK_TYPE_REMOTE
static val PLAYBACK_TYPE_REMOTE: Int
The session uses remote playback.
Value: 2
Public methods
getAudioAttributes
@Nullable fun getAudioAttributes(): AudioAttributesCompat?
Gets 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 |
getControlType
fun getControlType(): Int
Gets the type of volume control that can be used. One of:
VolumeProviderCompat#VOLUME_CONTROL_ABSOLUTE
VolumeProviderCompat#VOLUME_CONTROL_RELATIVE
VolumeProviderCompat#VOLUME_CONTROL_FIXED
Return | |
---|---|
Int |
the type of volume control that may be used with this session |
getCurrentVolume
fun getCurrentVolume(): Int
Gets 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 |
getMaxVolume
fun getMaxVolume(): Int
Gets 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 |
getPlaybackType
fun getPlaybackType(): Int
Gets the type of playback which affects volume handling. One of:
Return | |
---|---|
Int |
the type of playback this session is using |
hashCode
fun hashCode(): Int