public abstract static class MediaControllerCompat.TransportControls extends Object
Modifier and Type | Method and Description |
---|---|
abstract void |
fastForward()
Start fast forwarding.
|
abstract void |
pause()
Request that the player pause its playback and stay at its current
position.
|
abstract void |
play()
Request that the player start its playback at its current position.
|
abstract void |
playFromMediaId(String mediaId,
Bundle extras)
Request that the player start playback for a specific
Uri . |
abstract void |
playFromSearch(String query,
Bundle extras)
Request that the player start playback for a specific search query.
|
abstract void |
playFromUri(Uri uri,
Bundle extras)
Request that the player start playback for a specific
Uri . |
abstract void |
prepare()
Request that the player prepare its playback without audio focus.
|
abstract void |
prepareFromMediaId(String mediaId,
Bundle extras)
Request that the player prepare playback for a specific media id.
|
abstract void |
prepareFromSearch(String query,
Bundle extras)
Request that the player prepare playback for a specific search query.
|
abstract void |
prepareFromUri(Uri uri,
Bundle extras)
Request that the player prepare playback for a specific
Uri . |
abstract void |
rewind()
Start rewinding.
|
abstract void |
seekTo(long pos)
Move to a new location in the media stream.
|
abstract void |
sendCustomAction(PlaybackStateCompat.CustomAction customAction,
Bundle args)
Send a custom action for the
MediaSessionCompat to perform. |
abstract void |
sendCustomAction(String action,
Bundle args)
Send the id and args from a custom action for the
MediaSessionCompat to perform. |
abstract void |
setRating(RatingCompat rating)
Rate the current content.
|
abstract void |
skipToNext()
Skip to the next item.
|
abstract void |
skipToPrevious()
Skip to the previous item.
|
abstract void |
skipToQueueItem(long id)
Play an item with a specific id in the play queue.
|
abstract void |
stop()
Request that the player stop its playback; it may clear its state in
whatever way is appropriate.
|
public abstract void prepare()
PlaybackStateCompat.STATE_PAUSED
. Afterwards,
play()
can be called to start playback. If the preparation is not needed,
play()
can be directly called without this method.public abstract void prepareFromMediaId(String mediaId, Bundle extras)
PlaybackStateCompat.STATE_PAUSED
. Afterwards, play()
can be called to
start playback. If the preparation is not needed, playFromMediaId(java.lang.String, android.os.Bundle)
can
be directly called without this method.mediaId
- The id of the requested media.extras
- Optional extras that can include extra information about the media item
to be prepared.public abstract void prepareFromSearch(String query, Bundle extras)
PlaybackStateCompat.STATE_PAUSED
. Afterwards, play()
can be called to
start playback. If the preparation is not needed, playFromSearch(java.lang.String, android.os.Bundle)
can be directly
called without this method.query
- The search query.extras
- Optional extras that can include extra information
about the query.public abstract void prepareFromUri(Uri uri, Bundle extras)
Uri
.
In other words, other session can continue to play during the preparation of this
session. This method can be used to speed up the start of the playback.
Once the preparation is done, the session will change its playback state to
PlaybackStateCompat.STATE_PAUSED
. Afterwards, play()
can be called to
start playback. If the preparation is not needed, playFromUri(android.net.Uri, android.os.Bundle)
can be directly
called without this method.uri
- The URI of the requested media.extras
- Optional extras that can include extra information about the media item
to be prepared.public abstract void play()
public abstract void playFromMediaId(String mediaId, Bundle extras)
Uri
.mediaId
- The uri of the requested media.extras
- Optional extras that can include extra information
about the media item to be played.public abstract void playFromSearch(String query, Bundle extras)
query
- The search query.extras
- Optional extras that can include extra information
about the query.public abstract void playFromUri(Uri uri, Bundle extras)
Uri
.uri
- The URI of the requested media.extras
- Optional extras that can include extra information about the media item
to be played.public abstract void skipToQueueItem(long id)
public abstract void pause()
public abstract void stop()
public abstract void seekTo(long pos)
pos
- Position to move to, in milliseconds.public abstract void fastForward()
public abstract void skipToNext()
public abstract void rewind()
public abstract void skipToPrevious()
public abstract void setRating(RatingCompat rating)
MediaControllerCompat.getRatingType()
.rating
- The rating to set for the current contentpublic abstract void sendCustomAction(PlaybackStateCompat.CustomAction customAction, Bundle args)
MediaSessionCompat
to perform.customAction
- The action to perform.args
- Optional arguments to supply to the
MediaSessionCompat
for this custom action.public abstract void sendCustomAction(String action, Bundle args)
MediaSessionCompat
to perform.action
- The action identifier of the
PlaybackStateCompat.CustomAction
as specified by
the MediaSessionCompat
.args
- Optional arguments to supply to the
MediaSessionCompat
for this custom action.sendCustomAction(PlaybackStateCompat.CustomAction action,
Bundle args)