Interface ControlDispatcher

  • All Known Implementing Classes:
    DefaultControlDispatcher

    public interface ControlDispatcher
    Dispatches operations to the 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.

    • Method Detail

      • dispatchPrepare

        boolean dispatchPrepare​(Player player)
        Dispatches a Player.prepare() operation.
        Parameters:
        player - The Player 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 a Player.setPlayWhenReady(boolean) operation.
        Parameters:
        player - The Player 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 a Player.seekTo(int, long) operation.
        Parameters:
        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.
        Returns:
        True if the operation was dispatched. False if suppressed.
      • dispatchPrevious

        boolean dispatchPrevious​(Player player)
        Dispatches a Player.previous() operation.
        Parameters:
        player - The Player to which the operation should be dispatched.
        Returns:
        True if the operation was dispatched. False if suppressed.
      • dispatchNext

        boolean dispatchNext​(Player player)
        Dispatches a Player.next() operation.
        Parameters:
        player - The Player 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 - The Player 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 - The Player 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 a Player.setRepeatMode(int) operation.
        Parameters:
        player - The Player 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)
        Parameters:
        player - The Player 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 a Player.stop() operation.
        Parameters:
        player - The Player 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)
        Parameters:
        player - The Player to which the operation should be dispatched.
        playbackParameters - The playback parameters.
        Returns:
        True if the operation was dispatched. False if suppressed.
      • isRewindEnabled

        boolean isRewindEnabled()
        Returns true if rewind is enabled, false otherwise.
      • isFastForwardEnabled

        boolean isFastForwardEnabled()
        Returns true if fast forward is enabled, false otherwise.