java.lang.Object | |
↳ | android.media.session.PlaybackState |
Playback state for a MediaSession
. This includes a state like
STATE_PLAYING
, the current playback position,
and the current control capabilities.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PlaybackState.Builder |
Builder for PlaybackState objects.
|
||||||||||
PlaybackState.CustomAction |
CustomActions can be used to extend the capabilities of
the standard transport controls by exposing app specific actions to
MediaControllers .
|
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
long | ACTION_FAST_FORWARD | Indicates this session supports the fast forward command. | |||||||||
long | ACTION_PAUSE | Indicates this session supports the pause command. | |||||||||
long | ACTION_PLAY | Indicates this session supports the play command. | |||||||||
long | ACTION_PLAY_FROM_MEDIA_ID | Indicates this session supports the play from media id command. | |||||||||
long | ACTION_PLAY_FROM_SEARCH | Indicates this session supports the play from search command. | |||||||||
long | ACTION_PLAY_PAUSE | Indicates this session supports the play/pause toggle command. | |||||||||
long | ACTION_REWIND | Indicates this session supports the rewind command. | |||||||||
long | ACTION_SEEK_TO | Indicates this session supports the seek to command. | |||||||||
long | ACTION_SET_RATING | Indicates this session supports the set rating command. | |||||||||
long | ACTION_SKIP_TO_NEXT | Indicates this session supports the next command. | |||||||||
long | ACTION_SKIP_TO_PREVIOUS | Indicates this session supports the previous command. | |||||||||
long | ACTION_SKIP_TO_QUEUE_ITEM | Indicates this session supports the skip to queue item command. | |||||||||
long | ACTION_STOP | Indicates this session supports the stop command. | |||||||||
long | PLAYBACK_POSITION_UNKNOWN | Use this value for the position to indicate the position is not known. | |||||||||
int | STATE_BUFFERING | State indicating this item is currently buffering and will begin playing when enough data has buffered. | |||||||||
int | STATE_CONNECTING | State indicating the class doing playback is currently connecting to a new destination. | |||||||||
int | STATE_ERROR | State indicating this item is currently in an error state. | |||||||||
int | STATE_FAST_FORWARDING | State indicating this item is currently fast forwarding. | |||||||||
int | STATE_NONE | This is the default playback state and indicates that no media has been added yet, or the performer has been reset and has no content to play. | |||||||||
int | STATE_PAUSED | State indicating this item is currently paused. | |||||||||
int | STATE_PLAYING | State indicating this item is currently playing. | |||||||||
int | STATE_REWINDING | State indicating this item is currently rewinding. | |||||||||
int | STATE_SKIPPING_TO_NEXT | State indicating the player is currently skipping to the next item. | |||||||||
int | STATE_SKIPPING_TO_PREVIOUS | State indicating the player is currently skipping to the previous item. | |||||||||
int | STATE_SKIPPING_TO_QUEUE_ITEM | State indicating the player is currently skipping to a specific item in the queue. | |||||||||
int | STATE_STOPPED | State indicating this item is currently stopped. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
| |||||||||||
Get the current actions available on this session.
| |||||||||||
Get the id of the currently active item in the queue.
| |||||||||||
Get the current buffered position in ms.
| |||||||||||
Get the list of custom actions.
| |||||||||||
Get a user readable error message.
| |||||||||||
Get any custom extras that were set on this playback state.
| |||||||||||
Get the elapsed real time at which position was last updated.
| |||||||||||
Get the current playback speed as a multiple of normal playback.
| |||||||||||
Get the current playback position in ms.
| |||||||||||
Get the current state of playback.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
Flatten this object in to a Parcel.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
Indicates this session supports the fast forward command.
Indicates this session supports the pause command.
Indicates this session supports the play command.
Indicates this session supports the play from media id command.
Indicates this session supports the play from search command.
Indicates this session supports the play/pause toggle command.
Indicates this session supports the rewind command.
Indicates this session supports the seek to command.
Indicates this session supports the set rating command.
Indicates this session supports the next command.
Indicates this session supports the previous command.
Indicates this session supports the skip to queue item command.
Indicates this session supports the stop command.
Use this value for the position to indicate the position is not known.
State indicating this item is currently buffering and will begin playing when enough data has buffered.
State indicating the class doing playback is currently connecting to a
new destination. Depending on the implementation you may return to the previous
state when the connection finishes or enter STATE_NONE
.
If the connection failed STATE_ERROR
should be used.
State indicating this item is currently in an error state. The error message should also be set when entering this state.
State indicating this item is currently fast forwarding.
This is the default playback state and indicates that no media has been added yet, or the performer has been reset and has no content to play.
State indicating this item is currently paused.
State indicating this item is currently playing.
State indicating this item is currently rewinding.
State indicating the player is currently skipping to the next item.
State indicating the player is currently skipping to the previous item.
State indicating the player is currently skipping to a specific item in the queue.
State indicating this item is currently stopped.
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
Get the current actions available on this session. This should use a bitmask of the available actions.
Get the id of the currently active item in the queue. If there is no
queue or a queue is not supported by the session this will be
UNKNOWN_ID
.
UNKNOWN_ID
.
Get the current buffered position in ms. This is the farthest playback point that can be reached from the current position using only buffered content.
Get the list of custom actions.
Get a user readable error message. This should be set when the state is
STATE_ERROR
.
Get any custom extras that were set on this playback state.
Get the elapsed real time at which position was last updated. If the position has never been set this will return 0;
Get the current playback speed as a multiple of normal playback. This should be negative when rewinding. A value of 1 means normal playback and 0 means paused.
Get the current state of playback. One of the following:
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
Flatten this object in to a Parcel.
dest | The Parcel in which the object should be written. |
---|---|
flags | Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|