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.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaControllerCompat.PlaybackInfo\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:support-media-compat:28.0.0-alpha1 \nSummary: [Constants](#constants) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nMediaControllerCompat.PlaybackInfo\n==================================\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\nstatic\nfinal\n\nclass\nMediaControllerCompat.PlaybackInfo\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|---------------------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | android.support.v4.media.session.MediaControllerCompat.PlaybackInfo |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nHolds information about the way volume is handled for this session.\n\nSummary\n-------\n\n| ### Constants ||\n|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | [PLAYBACK_TYPE_LOCAL](/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#PLAYBACK_TYPE_LOCAL) The session uses local playback. |\n| `int` | [PLAYBACK_TYPE_REMOTE](/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#PLAYBACK_TYPE_REMOTE) The session uses remote playback. |\n\n| ### Public methods ||\n|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` int` | ` `[getAudioStream](/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getAudioStream())`() ` Gets the stream this is currently controlling volume on. |\n| ` int` | ` `[getCurrentVolume](/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getCurrentVolume())`() ` Gets the current volume for this session. |\n| ` int` | ` `[getMaxVolume](/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getMaxVolume())`() ` Gets the maximum volume that may be set for this session. |\n| ` int` | ` `[getPlaybackType](/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getPlaybackType())`() ` Gets the type of volume handling, either local or remote. |\n| ` int` | ` `[getVolumeControl](/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#getVolumeControl())`() ` Gets the type of volume control that can be used. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nConstants\n---------\n\n### PLAYBACK_TYPE_LOCAL\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nint PLAYBACK_TYPE_LOCAL\n```\n\nThe session uses local playback.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\n### PLAYBACK_TYPE_REMOTE\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nint PLAYBACK_TYPE_REMOTE\n```\n\nThe session uses remote playback.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n2\n(0x00000002)\n\n\nPublic methods\n--------------\n\n### getAudioStream\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nint getAudioStream ()\n```\n\nGets the stream this is currently controlling volume on. When the volume\ntype is [PLAYBACK_TYPE_REMOTE](/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#PLAYBACK_TYPE_REMOTE) this value does not\nhave meaning and should be ignored.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|-----------------------------------------------|\n| `int` | The stream this session is playing on. \u003cbr /\u003e |\n\n### getCurrentVolume\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nint getCurrentVolume ()\n```\n\nGets the current volume for this session.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|----------------------------------------------------------|\n| `int` | The current volume where this session is playing. \u003cbr /\u003e |\n\n### getMaxVolume\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nint getMaxVolume ()\n```\n\nGets the maximum volume that may be set for this session.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|------------------------------------------------------------------|\n| `int` | The maximum allowed volume where this session is playing. \u003cbr /\u003e |\n\n### getPlaybackType\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nint getPlaybackType ()\n```\n\nGets the type of volume handling, either local or remote. One of:\n\n- [PLAYBACK_TYPE_LOCAL](/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#PLAYBACK_TYPE_LOCAL)\n- [PLAYBACK_TYPE_REMOTE](/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo#PLAYBACK_TYPE_REMOTE)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|-----------------------------------------------------------|\n| `int` | The type of volume handling this session is using. \u003cbr /\u003e |\n\n### getVolumeControl\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nint getVolumeControl ()\n```\n\nGets the type of volume control that can be used. One of:\n\n- [VOLUME_CONTROL_ABSOLUTE](/reference/android/support/v4/media/VolumeProviderCompat#VOLUME_CONTROL_ABSOLUTE)\n- [VOLUME_CONTROL_RELATIVE](/reference/android/support/v4/media/VolumeProviderCompat#VOLUME_CONTROL_RELATIVE)\n- [VOLUME_CONTROL_FIXED](/reference/android/support/v4/media/VolumeProviderCompat#VOLUME_CONTROL_FIXED)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|-----------------------------------------------------------------------|\n| `int` | The type of volume control that may be used with this session. \u003cbr /\u003e |\n\n-\n\n Interfaces\n ----------\n\n - [MediaSessionCompat.OnActiveChangeListener](/reference/android/support/v4/media/session/MediaSessionCompat.OnActiveChangeListener)\n-\n\n Classes\n -------\n\n - [MediaButtonReceiver](/reference/android/support/v4/media/session/MediaButtonReceiver)\n - [MediaControllerCompat](/reference/android/support/v4/media/session/MediaControllerCompat)\n - [MediaControllerCompat.Callback](/reference/android/support/v4/media/session/MediaControllerCompat.Callback)\n - [MediaControllerCompat.PlaybackInfo](/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo)\n - [MediaControllerCompat.TransportControls](/reference/android/support/v4/media/session/MediaControllerCompat.TransportControls)\n - [MediaSessionCompat](/reference/android/support/v4/media/session/MediaSessionCompat)\n - [MediaSessionCompat.Callback](/reference/android/support/v4/media/session/MediaSessionCompat.Callback)\n - [MediaSessionCompat.QueueItem](/reference/android/support/v4/media/session/MediaSessionCompat.QueueItem)\n - [MediaSessionCompat.Token](/reference/android/support/v4/media/session/MediaSessionCompat.Token)\n - [ParcelableVolumeInfo](/reference/android/support/v4/media/session/ParcelableVolumeInfo)\n - [PlaybackStateCompat](/reference/android/support/v4/media/session/PlaybackStateCompat)\n - [PlaybackStateCompat.Builder](/reference/android/support/v4/media/session/PlaybackStateCompat.Builder)\n - [PlaybackStateCompat.CustomAction](/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction)\n - [PlaybackStateCompat.CustomAction.Builder](/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder)"]]