ControlDispatcherpublic class DefaultControlDispatcher extends Object implements ControlDispatcher
ControlDispatcher.| Modifier and Type | Field | 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.
|
| Constructor | Description |
|---|---|
DefaultControlDispatcher() |
Creates an instance.
|
DefaultControlDispatcher(long fastForwardIncrementMs,
long rewindIncrementMs) |
Creates an instance with the given increments.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
dispatchFastForward(Player player) |
Dispatches a fast forward operation.
|
boolean |
dispatchNext(Player player) |
Dispatches a
Player.next() operation. |
boolean |
dispatchPrepare(Player player) |
Dispatches a
Player.prepare() operation. |
boolean |
dispatchPrevious(Player player) |
Dispatches a
Player.previous() operation. |
boolean |
dispatchRewind(Player player) |
Dispatches a rewind operation.
|
boolean |
dispatchSeekTo(Player player,
int windowIndex,
long positionMs) |
Dispatches a
Player.seekTo(int, long) operation. |
boolean |
dispatchSetPlaybackParameters(Player player,
PlaybackParameters playbackParameters) |
Dispatches a
Player.setPlaybackParameters(PlaybackParameters) operation. |
boolean |
dispatchSetPlayWhenReady(Player player,
boolean playWhenReady) |
Dispatches a
Player.setPlayWhenReady(boolean) operation. |
boolean |
dispatchSetRepeatMode(Player player,
int repeatMode) |
Dispatches a
Player.setRepeatMode(int) operation. |
boolean |
dispatchSetShuffleModeEnabled(Player player,
boolean shuffleModeEnabled) |
Dispatches a
Player.setShuffleModeEnabled(boolean) operation. |
boolean |
dispatchStop(Player player,
boolean reset) |
Dispatches a
Player.stop() operation. |
long |
getFastForwardIncrementMs() |
Returns the fast forward increment in milliseconds.
|
long |
getRewindIncrementMs() |
Returns the rewind increment in milliseconds.
|
boolean |
isFastForwardEnabled() |
Returns
true if fast forward is enabled, false otherwise. |
boolean |
isRewindEnabled() |
Returns
true if rewind is enabled, false otherwise. |
void |
setFastForwardIncrementMs(long fastForwardMs) |
Deprecated.
Create a new instance instead and pass the new instance to the UI component.
|
void |
setRewindIncrementMs(long rewindMs) |
Deprecated.
Create a new instance instead and pass the new instance to the UI component.
|
public static final int DEFAULT_FAST_FORWARD_MS
public static final int DEFAULT_REWIND_MS
public DefaultControlDispatcher()
public DefaultControlDispatcher(long fastForwardIncrementMs,
long rewindIncrementMs)
fastForwardIncrementMs - The fast forward increment in milliseconds. A non-positive value
disables the fast forward operation.rewindIncrementMs - The rewind increment in milliseconds. A non-positive value disables
the rewind operation.public boolean dispatchPrepare(Player player)
ControlDispatcherPlayer.prepare() operation.dispatchPrepare in interface ControlDispatcherplayer - The Player to which the operation should be dispatched.public boolean dispatchSetPlayWhenReady(Player player, boolean playWhenReady)
ControlDispatcherPlayer.setPlayWhenReady(boolean) operation.dispatchSetPlayWhenReady in interface ControlDispatcherplayer - The Player to which the operation should be dispatched.playWhenReady - Whether playback should proceed when ready.public boolean dispatchSeekTo(Player player, int windowIndex, long positionMs)
ControlDispatcherPlayer.seekTo(int, long) operation.dispatchSeekTo in interface ControlDispatcherplayer - The Player to which the operation should be dispatched.windowIndex - The index of the window.positionMs - The seek position in the specified window, or C.TIME_UNSET to seek to
the window's default position.public boolean dispatchPrevious(Player player)
ControlDispatcherPlayer.previous() operation.dispatchPrevious in interface ControlDispatcherplayer - The Player to which the operation should be dispatched.public boolean dispatchNext(Player player)
ControlDispatcherPlayer.next() operation.dispatchNext in interface ControlDispatcherplayer - The Player to which the operation should be dispatched.public boolean dispatchRewind(Player player)
ControlDispatcherdispatchRewind in interface ControlDispatcherplayer - The Player to which the operation should be dispatched.public boolean dispatchFastForward(Player player)
ControlDispatcherdispatchFastForward in interface ControlDispatcherplayer - The Player to which the operation should be dispatched.public boolean dispatchSetRepeatMode(Player player, @RepeatMode int repeatMode)
ControlDispatcherPlayer.setRepeatMode(int) operation.dispatchSetRepeatMode in interface ControlDispatcherplayer - The Player to which the operation should be dispatched.repeatMode - The repeat mode.public boolean dispatchSetShuffleModeEnabled(Player player, boolean shuffleModeEnabled)
ControlDispatcherPlayer.setShuffleModeEnabled(boolean) operation.dispatchSetShuffleModeEnabled in interface ControlDispatcherplayer - The Player to which the operation should be dispatched.shuffleModeEnabled - Whether shuffling is enabled.public boolean dispatchStop(Player player, boolean reset)
ControlDispatcherPlayer.stop() operation.dispatchStop in interface ControlDispatcherplayer - The Player to which the operation should be dispatched.reset - Whether the player should be reset.public boolean dispatchSetPlaybackParameters(Player player, PlaybackParameters playbackParameters)
ControlDispatcherPlayer.setPlaybackParameters(PlaybackParameters) operation.dispatchSetPlaybackParameters in interface ControlDispatcherplayer - The Player to which the operation should be dispatched.playbackParameters - The playback parameters.public boolean isRewindEnabled()
ControlDispatchertrue if rewind is enabled, false otherwise.isRewindEnabled in interface ControlDispatcherpublic boolean isFastForwardEnabled()
ControlDispatchertrue if fast forward is enabled, false otherwise.isFastForwardEnabled in interface ControlDispatcherpublic long getRewindIncrementMs()
public long getFastForwardIncrementMs()
@Deprecated public void setRewindIncrementMs(long rewindMs)
@Deprecated public void setFastForwardIncrementMs(long fastForwardMs)