java.lang.Object
uk.co.caprica.vlcj.player.list.ControlsApi
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 TypeMethodDescriptionvoid
pause()
Toggle-pause the media list.void
play()
Play the media list.boolean
play
(int itemIndex) Play a particular item on the media list.boolean
playNext()
Play the next item in the media list.boolean
Play the previous item in the media list.boolean
setMode
(PlaybackMode mode) Set the media list play mode.void
setPause
(boolean pause) Pause/un-pause the media list.void
stop()
Stop the media list.
-
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, otherwisefalse
-
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, otherwisefalse
-
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, otherwisefalse
-
setMode
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
-