MediaControllerCompat.TransportControls

public static abstract class MediaControllerCompat.TransportControls
extends Object

java.lang.Object
   ↳ android.support.v4.media.session.MediaControllerCompat.TransportControls


Interface for controlling media playback on a session. This allows an app to send media transport commands to the session.

Summary

Constants

String EXTRA_LEGACY_STREAM_TYPE

This constant is deprecated. Use MediaConstants.TRANSPORT_CONTROLS_EXTRAS_KEY_LEGACY_STREAM_TYPE instead.

Public methods

abstract void fastForward()

Starts 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 media id.

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 for playback.

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()

Starts rewinding.

abstract void seekTo(long pos)

Moves to a new location in the media stream.

abstract void sendCustomAction(String action, Bundle args)

Sends the id and args from a custom action for the MediaSessionCompat to perform.

abstract void sendCustomAction(PlaybackStateCompat.CustomAction customAction, Bundle args)

Sends a custom action for the MediaSessionCompat to perform.

abstract void setCaptioningEnabled(boolean enabled)

Enables/disables captioning for this session.

void setPlaybackSpeed(float speed)

Sets the playback speed.

abstract void setRating(RatingCompat rating, Bundle extras)

Rates a media item.

abstract void setRating(RatingCompat rating)

Rates the current content.

abstract void setRepeatMode(int repeatMode)

Sets the repeat mode for this session.

abstract void setShuffleMode(int shuffleMode)

Sets the shuffle mode for this session.

abstract void skipToNext()

Skips to the next item.

abstract void skipToPrevious()

Skips to the previous item.

abstract void skipToQueueItem(long id)

Plays 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.

Inherited methods

Constants

EXTRA_LEGACY_STREAM_TYPE

public static final String EXTRA_LEGACY_STREAM_TYPE

This constant is deprecated.
Use MediaConstants.TRAN