Class ControlsApi

java.lang.Object
uk.co.caprica.vlcj.player.list.ControlsApi

public final class ControlsApi extends Object
Behaviour pertaining to media list player controls, like play, pause, stop of the list as a whole, play a specific item, play next item, play previous item.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Toggle-pause the media list.
    void
    Play the media list.
    boolean
    play(int itemIndex)
    Play a particular item on the media list.
    boolean
    Play the next item in the media list.
    boolean
    Play the previous item in the media list.
    boolean
    Set the media list play mode.
    void
    setPause(boolean pause)
    Pause/un-pause the media list.
    void
    Stop the media list.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • play

      public void play()
      Play the media list.

      If the play mode is PlaybackMode.REPEAT no item will be played and a "media list end reached" event will be raised.

    • pause

      public void pause()
      Toggle-pause the media list.
    • setPause

      public void setPause(boolean pause)
      Pause/un-pause the media list.
      Parameters:
      pause - true to pause; false to un-pause
    • stop

      public void stop()
      Stop the media list.
    • play

      public boolean play(int itemIndex)
      Play a particular item on the media list.

      When the mode is PlaybackMode.REPEAT this method is the only way to successfully play media in the list.

      Parameters:
      itemIndex - index of the item to play
      Returns:
      true if the item could be played, otherwise false
    • playNext

      public boolean playNext()
      Play the next item in the media list.

      When the mode is PlaybackMode.REPEAT this method will replay the current media, not the next one.

      Returns:
      true if the next item could be played, otherwise false
    • playPrevious

      public boolean playPrevious()
      Play the previous item in the media list.

      When the mode is PlaybackMode.REPEAT this method will replay the current media, not the previous one.

      Returns:
      true if the previous item could be played, otherwise false
    • setMode

      public boolean setMode(PlaybackMode mode)
      Set the media list play mode.

      Note that if setting the play mode to PlaybackMode.REPEAT you can not simply play the media list, you must instead play a particular item (by its index).

      Parameters:
      mode - mode
      Returns:
      true on success; false on error