PlaybackInfo
class PlaybackInfo : VersionedParcelable
kotlin.Any | |
↳ | androidx.media2.session.MediaController.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 |
|
---|---|
Boolean | |
AudioAttributesCompat? |
Get the audio attributes for this session. |
Int |
Get the type of volume control that can be used. |
Int |
Get the current volume for this session. |
Int |
Get the maximum volume that may be set for this session. |
Int |
Get 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?
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 |
getControlType
fun getControlType(): Int
Get 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
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 |
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 |
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 |
hashCode
fun hashCode(): Int