Android APIs
public abstract class

TransportController

extends Object
java.lang.Object
   ↳ android.support.v4.media.TransportController
Known Direct Subclasses

Class Overview

Base interface to controlling a media transport. This is the interface for implementing things like on-screen controls: it allows them to request changes in playback, retrieve the current playback state, and monitor for changes to the playback state.

Summary

Public Constructors
TransportController()
Public Methods
abstract int getBufferPercentage()
Retrieve amount, in percentage (0-100), that the media stream has been buffered on to the local device.
abstract long getCurrentPosition()
Retrieve the current playback location in the media stream, in milliseconds.
abstract long getDuration()
Retrieve the total duration of the media stream, in milliseconds.
abstract int getTransportControlFlags()
Retrieve the flags for the media transport control buttons that this transport supports.
abstract boolean isPlaying()
Return whether the player is currently playing its stream.
abstract void pausePlaying()
Request that the player pause its playback and stay at its current position.
abstract void registerStateListener(TransportStateListener listener)
Start listening to changes in playback state.
abstract void seekTo(long pos)
Move to a new location in the media stream.
abstract void startPlaying()
Request that the player start its playback at its current position.
abstract void stopPlaying()
Request that the player stop its playback; it may clear its state in whatever way is appropriate.
abstract void unregisterStateListener(TransportStateListener listener)
Stop listening to changes in playback state.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TransportController ()

Public Methods

public abstract int getBufferPercentage ()

Retrieve amount, in percentage (0-100), that the media stream has been buffered on to the local device. Return 100 if the stream is always local.

public abstract long getCurrentPosition ()

Retrieve the current playback location in the media stream, in milliseconds.

public abstract long getDuration ()

Retrieve the total duration of the media stream, in milliseconds.

public abstract int getTransportControlFlags ()

Retrieve the flags for the media transport control buttons that this transport supports. Result is a combination of the following flags: FLAG_KEY_MEDIA_PREVIOUS, FLAG_KEY_MEDIA_REWIND, FLAG_KEY_MEDIA_PLAY, FLAG_KEY_MEDIA_PLAY_PAUSE, FLAG_KEY_MEDIA_PAUSE, FLAG_KEY_MEDIA_STOP, FLAG_KEY_MEDIA_FAST_FORWARD, FLAG_KEY_MEDIA_NEXT

public abstract boolean isPlaying ()

Return whether the player is currently playing its stream.

public abstract void pausePlaying ()

Request that the player pause its playback and stay at its current position.

public abstract void registerStateListener (TransportStateListener listener)

Start listening to changes in playback state.

public abstract void seekTo (long pos)

Move to a new location in the media stream.

Parameters
pos Position to move to, in milliseconds.

public abstract void startPlaying ()

Request that the player start its playback at its current position.

public abstract void stopPlaying ()

Request that the player stop its playback; it may clear its state in whatever way is appropriate.

public abstract void unregisterStateListener (TransportStateListener listener)

Stop listening to changes in playback state.