DefaultControlDispatcher
public interface ControlDispatcher
Player
.
Implementations may choose to suppress (e.g. prevent playback from resuming if audio focus is denied) or modify (e.g. change the seek position to prevent a user from seeking past a non-skippable advert) operations.
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. |
boolean |
isFastForwardEnabled() |
Returns
true if fast forward is enabled, false otherwise. |
boolean |
isRewindEnabled() |
Returns
true if rewind is enabled, false otherwise. |
boolean dispatchPrepare(Player player)
Player.prepare()
operation.player
- The Player
to which the operation should be dispatched.boolean dispatchSetPlayWhenReady(Player player, boolean playWhenReady)
Player.setPlayWhenReady(boolean)
operation.player
- The Player
to which the operation should be dispatched.playWhenReady
- Whether playback should proceed when ready.boolean dispatchSeekTo(Player player, int windowIndex, long positionMs)
Player.seekTo(int, long)
operation.player
- 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.boolean dispatchPrevious(Player player)
Player.previous()
operation.player
- The Player
to which the operation should be dispatched.boolean dispatchNext(Player player)
Player.next()
operation.player
- The Player
to which the operation should be dispatched.boolean dispatchRewind(Player player)
player
- The Player
to which the operation should be dispatched.boolean dispatchFastForward(Player player)
player
- The Player
to which the operation should be dispatched.boolean dispatchSetRepeatMode(Player player, @RepeatMode int repeatMode)
Player.setRepeatMode(int)
operation.player
- The Player
to which the operation should be dispatched.repeatMode
- The repeat mode.boolean dispatchSetShuffleModeEnabled(Player player, boolean shuffleModeEnabled)
Player.setShuffleModeEnabled(boolean)
operation.player
- The Player
to which the operation should be dispatched.shuffleModeEnabled
- Whether shuffling is enabled.boolean dispatchStop(Player player, boolean reset)
Player.stop()
operation.player
- The Player
to which the operation should be dispatched.reset
- Whether the player should be reset.boolean dispatchSetPlaybackParameters(Player player, PlaybackParameters playbackParameters)
Player.setPlaybackParameters(PlaybackParameters)
operation.player
- The Player
to which the operation should be dispatched.playbackParameters
- The playback parameters.boolean isRewindEnabled()
true
if rewind is enabled, false
otherwise.boolean isFastForwardEnabled()
true
if fast forward is enabled, false
otherwise.