Package com.google.android.exoplayer2
Interface ControlDispatcher
-
- All Known Implementing Classes:
DefaultControlDispatcher
public interface ControlDispatcher
Dispatches operations to thePlayer
.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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
dispatchFastForward(Player player)
Dispatches a fast forward operation.boolean
dispatchNext(Player player)
Dispatches aPlayer.next()
operation.boolean
dispatchPrepare(Player player)
Dispatches aPlayer.prepare()
operation.boolean
dispatchPrevious(Player player)
Dispatches aPlayer.previous()
operation.boolean
dispatchRewind(Player player)
Dispatches a rewind operation.boolean
dispatchSeekTo(Player player, int windowIndex, long positionMs)
Dispatches aPlayer.seekTo(int, long)
operation.boolean
dispatchSetPlaybackParameters(Player player, PlaybackParameters playbackParameters)
Dispatches aPlayer.setPlaybackParameters(PlaybackParameters)
operation.boolean
dispatchSetPlayWhenReady(Player player, boolean playWhenReady)
Dispatches aPlayer.setPlayWhenReady(boolean)
operation.boolean
dispatchSetRepeatMode(Player player, int repeatMode)
Dispatches aPlayer.setRepeatMode(int)
operation.boolean
dispatchSetShuffleModeEnabled(Player player, boolean shuffleModeEnabled)
Dispatches aPlayer.setShuffleModeEnabled(boolean)
operation.boolean
dispatchStop(Player player, boolean reset)
Dispatches aPlayer.stop()
operation.boolean
isFastForwardEnabled()
Returnstrue
if fast forward is enabled,false
otherwise.boolean
isRewindEnabled()
Returnstrue
if rewind is enabled,false
otherwise.
-
-
-
Method Detail
-
dispatchPrepare
boolean dispatchPrepare(Player player)
Dispatches aPlayer.prepare()
operation.- Parameters:
player
- ThePlayer
to which the operation should be dispatched.- Returns:
- True if the operation was dispatched. False if suppressed.
-
dispatchSetPlayWhenReady
boolean dispatchSetPlayWhenReady(Player player, boolean playWhenReady)
Dispatches aPlayer.setPlayWhenReady(boolean)
operation.- Parameters:
player
- ThePlayer
to which the operation should be dispatched.playWhenReady
- Whether playback should proceed when ready.- Returns:
- True if the operation was dispatched. False if suppressed.
-
dispatchSeekTo
boolean dispatchSeekTo(Player player, int windowIndex, long positionMs)
Dispatches aPlayer.seekTo(int, long)
operation.- Parameters:
player
- ThePlayer
to which the operation should be dispatched.windowIndex
- The index of the window.positionMs
- The seek position in the specified window, orC.TIME_UNSET
to seek to the window's default position.- Returns:
- True if the operation was dispatched. False if suppressed.
-
dispatchPrevious
boolean dispatchPrevious(Player player)
Dispatches aPlayer.previous()
operation.- Parameters:
player
- ThePlayer
to which the operation should be dispatched.- Returns:
- True if the operation was dispatched. False if suppressed.
-
dispatchNext
boolean dispatchNext(Player player)
Dispatches aPlayer.next()
operation.- Parameters:
player
- ThePlayer
to which the operation should be dispatched.- Returns:
- True if the operation was dispatched. False if suppressed.
-
dispatchRewind
boolean dispatchRewind(Player player)
Dispatches a rewind operation.- Parameters:
player
- ThePlayer
to which the operation should be dispatched.- Returns:
- True if the operation was dispatched. False if suppressed.
-
dispatchFastForward
boolean dispatchFastForward(Player player)
Dispatches a fast forward operation.- Parameters:
player
- ThePlayer
to which the operation should be dispatched.- Returns:
- True if the operation was dispatched. False if suppressed.
-
dispatchSetRepeatMode
boolean dispatchSetRepeatMode(Player player, @RepeatMode int repeatMode)
Dispatches aPlayer.setRepeatMode(int)
operation.- Parameters:
player
- ThePlayer
to which the operation should be dispatched.repeatMode
- The repeat mode.- Returns:
- True if the operation was dispatched. False if suppressed.
-
dispatchSetShuffleModeEnabled
boolean dispatchSetShuffleModeEnabled(Player player, boolean shuffleModeEnabled)
Dispatches aPlayer.setShuffleModeEnabled(boolean)
operation.- Parameters:
player
- ThePlayer
to which the operation should be dispatched.shuffleModeEnabled
- Whether shuffling is enabled.- Returns:
- True if the operation was dispatched. False if suppressed.
-
dispatchStop
boolean dispatchStop(Player player, boolean reset)
Dispatches aPlayer.stop()
operation.- Parameters:
player
- ThePlayer
to which the operation should be dispatched.reset
- Whether the player should be reset.- Returns:
- True if the operation was dispatched. False if suppressed.
-
dispatchSetPlaybackParameters
boolean dispatchSetPlaybackParameters(Player player, PlaybackParameters playbackParameters)
Dispatches aPlayer.setPlaybackParameters(PlaybackParameters)
operation.- Parameters:
player
- ThePlayer
to which the operation should be dispatched.playbackParameters
- The playback parameters.- Returns:
- True if the operation was dispatched. False if suppressed.
-
isRewindEnabled
boolean isRewindEnabled()
Returnstrue
if rewind is enabled,false
otherwise.
-
isFastForwardEnabled
boolean isFastForwardEnabled()
Returnstrue
if fast forward is enabled,false
otherwise.
-
-