FileDocCategorySizeDatePackage
TransportController.javaAPI DocAndroid 5.1 API3226Thu Mar 12 22:22:56 GMT 2015android.support.v4.media

TransportController

public abstract class TransportController extends Object
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.

Fields Summary
Constructors Summary
Methods Summary
public abstract intgetBufferPercentage()
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 longgetCurrentPosition()
Retrieve the current playback location in the media stream, in milliseconds.

public abstract longgetDuration()
Retrieve the total duration of the media stream, in milliseconds.

public abstract intgetTransportControlFlags()
Retrieve the flags for the media transport control buttons that this transport supports. Result is a combination of the following flags: {@link TransportMediator#FLAG_KEY_MEDIA_PREVIOUS}, {@link TransportMediator#FLAG_KEY_MEDIA_REWIND}, {@link TransportMediator#FLAG_KEY_MEDIA_PLAY}, {@link TransportMediator#FLAG_KEY_MEDIA_PLAY_PAUSE}, {@link TransportMediator#FLAG_KEY_MEDIA_PAUSE}, {@link TransportMediator#FLAG_KEY_MEDIA_STOP}, {@link TransportMediator#FLAG_KEY_MEDIA_FAST_FORWARD}, {@link TransportMediator#FLAG_KEY_MEDIA_NEXT}

public abstract booleanisPlaying()
Return whether the player is currently playing its stream.

public abstract voidpausePlaying()
Request that the player pause its playback and stay at its current position.

public abstract voidregisterStateListener(TransportStateListener listener)
Start listening to changes in playback state.

public abstract voidseekTo(long pos)
Move to a new location in the media stream.

param
pos Position to move to, in milliseconds.

public abstract voidstartPlaying()
Request that the player start its playback at its current position.

public abstract voidstopPlaying()
Request that the player stop its playback; it may clear its state in whatever way is appropriate.

public abstract voidunregisterStateListener(TransportStateListener listener)
Stop listening to changes in playback state.