Package com.google.android.exoplayer2
Interface ControlDispatcher
-
- All Known Implementing Classes:
DefaultControlDispatcher
public interface ControlDispatcherDispatches 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 booleandispatchFastForward(Player player)Dispatches a fast forward operation.booleandispatchNext(Player player)Dispatches aPlayer.next()operation.booleandispatchPrepare(Player player)Dispatches aPlayer.prepare()operation.booleandispatchPrevious(Player player)Dispatches aPlayer.previous()operation.booleandispatchRewind(Player player)Dispatches a rewind operation.booleandispatchSeekTo(Player player, int windowIndex, long positionMs)Dispatches aPlayer.seekTo(int, long)operation.booleandispatchSetPlaybackParameters(Player player, PlaybackParameters playbackParameters)Dispatches aPlayer.setPlaybackParameters(PlaybackParameters)operation.booleandispatchSetPlayWhenReady(Player player, boolean playWhenReady)Dispatches aPlayer.setPlayWhenReady(boolean)operation.booleandispatchSetRepeatMode(Player player, int repeatMode)Dispatches aPlayer.setRepeatMode(int)operation.booleandispatchSetShuffleModeEnabled(Player player, boolean shuffleModeEnabled)Dispatches aPlayer.setShuffleModeEnabled(boolean)operation.booleandispatchStop(Player player, boolean reset)Dispatches aPlayer.stop()operation.booleanisFastForwardEnabled()Returnstrueif fast forward is enabled,falseotherwise.booleanisRewindEnabled()Returnstrueif rewind is enabled,falseotherwise.
-
-
-
Method Detail
-
dispatchPrepare
boolean dispatchPrepare(Player player)
Dispatches aPlayer.prepare()operation.- Parameters:
player- ThePlayerto 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- ThePlayerto 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- ThePlayerto which the operation should be dispatched.windowIndex- The index of the window.positionMs- The seek position in the specified window, orC.TIME_UNSETto 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- ThePlayerto 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- ThePlayerto 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- ThePlayerto 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- ThePlayerto 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- ThePlayerto 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- ThePlayerto 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- ThePlayerto 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- ThePlayerto which the operation should be dispatched.playbackParameters- The playback parameters.- Returns:
- True if the operation was dispatched. False if suppressed.
-
isRewindEnabled
boolean isRewindEnabled()
Returnstrueif rewind is enabled,falseotherwise.
-
isFastForwardEnabled
boolean isFastForwardEnabled()
Returnstrueif fast forward is enabled,falseotherwise.
-
-