public class DefaultPlaybackController extends Object implements MediaSessionConnector.PlaybackController
MediaSessionConnector.PlaybackController.
Methods can be safely overridden by subclasses to intercept calls for given actions.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_FAST_FORWARD_MS
The default fast forward increment, in milliseconds.
|
static int |
DEFAULT_REWIND_MS
The default rewind increment, in milliseconds.
|
protected long |
fastForwardIncrementMs |
protected long |
rewindIncrementMs |
ACTIONS| Constructor and Description |
|---|
DefaultPlaybackController()
Creates a new instance.
|
DefaultPlaybackController(long rewindIncrementMs,
long fastForwardIncrementMs)
Creates a new instance with the given fast forward and rewind increments.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getSupportedPlaybackActions(Player player)
Returns the actions which are supported by the controller.
|
void |
onFastForward(Player player)
See
MediaSessionCompat.Callback#onFastForward(). |
void |
onPause(Player player)
See
MediaSessionCompat.Callback#onPause(). |
void |
onPlay(Player player)
See
MediaSessionCompat.Callback#onPlay(). |
void |
onRewind(Player player)
See
MediaSessionCompat.Callback#onRewind(). |
void |
onSeekTo(Player player,
long position)
See
MediaSessionCompat.Callback#onSeekTo(long). |
void |
onStop(Player player)
See
MediaSessionCompat.Callback#onStop(). |
public static final int DEFAULT_FAST_FORWARD_MS
public static final int DEFAULT_REWIND_MS
protected final long rewindIncrementMs
protected final long fastForwardIncrementMs
public DefaultPlaybackController()
Equivalent to DefaultPlaybackController(
DefaultPlaybackController.DEFAULT_REWIND_MS,
DefaultPlaybackController.DEFAULT_FAST_FORWARD_MS).
public DefaultPlaybackController(long rewindIncrementMs,
long fastForwardIncrementMs)
rewindIncrementMs - The rewind increment in milliseconds. A zero or negative value will
cause the rewind action to be disabled.fastForwardIncrementMs - The fast forward increment in milliseconds. A zero or negative
value will cause the fast forward action to be removed.public long getSupportedPlaybackActions(Player player)
MediaSessionConnector.PlaybackControllerPlaybackStateCompat.ACTION_PLAY_PAUSE,
PlaybackStateCompat.ACTION_PLAY, PlaybackStateCompat.ACTION_PAUSE,
PlaybackStateCompat.ACTION_SEEK_TO, PlaybackStateCompat.ACTION_FAST_FORWARD,
PlaybackStateCompat.ACTION_REWIND and PlaybackStateCompat.ACTION_STOP.getSupportedPlaybackActions in interface MediaSessionConnector.PlaybackControllerplayer - The player.public void onPlay(Player player)
MediaSessionConnector.PlaybackControllerMediaSessionCompat.Callback#onPlay().onPlay in interface MediaSessionConnector.PlaybackControllerpublic void onPause(Player player)
MediaSessionConnector.PlaybackControllerMediaSessionCompat.Callback#onPause().onPause in interface MediaSessionConnector.PlaybackControllerpublic void onSeekTo(Player player, long position)
MediaSessionConnector.PlaybackControllerMediaSessionCompat.Callback#onSeekTo(long).onSeekTo in interface MediaSessionConnector.PlaybackControllerpublic void onFastForward(Player player)
MediaSessionConnector.PlaybackControllerMediaSessionCompat.Callback#onFastForward().onFastForward in interface MediaSessionConnector.PlaybackControllerpublic void onRewind(Player player)
MediaSessionConnector.PlaybackControllerMediaSessionCompat.Callback#onRewind().onRewind in interface MediaSessionConnector.PlaybackControllerpublic void onStop(Player player)
MediaSessionConnector.PlaybackControllerMediaSessionCompat.Callback#onStop().onStop in interface MediaSessionConnector.PlaybackController