Methods to control and manage the VLC playlist.

Availability

Script Types
Extension, Interface

prev()

Play previous track.

Usage

if should_go_back then
	vlc.playlist.prev()
end

next()

Play next track.

Usage

if should_goto_next then
	vlc.playlist.next()
end

skip()

Skip one or more tracks.

Parameters


play()

Start playback.


pause()

Pause playback.


stop()

Stop playback.


clear()

Clear the playlist.


repeat()

Toggle item repeat or set it to a specified value.

Parameters

Return value

Boolean value: true if repeat is enabled, false otherwise


repeat_()

Alias of repeat(), provided since repeat is a reserved Lua keyword.


loop()

Toggle playlist loop or set it to a specified value.

Parameters

Return value

Boolean value: true if loop is enabled, false otherwise


random()

Toggle randomized payback or set it to specified value.

Parameters

Return value

Boolean value: true if random playback is enabled, false otherwise


get_repeat()

Get current repeat mode.

Return value

Boolean value: true if repeat is enabled, false otherwise


get_loop()

Get current loop mode.

Return value

Boolean value: true if loop is enabled, false otherwise


get_random()

Get current random mode.

Return value

Boolean value: true if random playback is enabled, false otherwise


goto()

Go to a specified track in the playlist.
Provided for Lua <5.0.2

Parameters

Return value

Two values:


gotoitem()

Alias of goto() provided for all Lua versions.


add()

Add one or more items to the playlist, tracks are played when added.

Parameters

Return value

Integer value indicating how many items were added to the playlist


enqueue()

Same as add(), but tracks are not played when added.


get()

Get an item from the current playlist.

Parameters

Return value

The specified playlist item


list()

Get list of all playlist items in current playlist.

Return value

List of all the playlist items in the current playlist


current()

Get the ID of the current playlist item.

Return value

Integer value: identifier of the current playlist item


current_item()

Get the current playlist item.

Return value

The current playlist item


sort()

Sort the current playlist according to a given key.

Parameters

Return value

Two values that indicate how the sort operation went:


status()

Get the status of the current playlist.

Return value

String literal value, one of: "stopped", "started", "playing", "paused", "stopping", "unknown"


delete()

Check if an item is in the current playlist and delete it.

Parameters

Return value

Two values that indicate how the delete operation went:


move()

Move a playlist item. This operation shifts the target item by one if the current item is before the target.

Parameters

Return value

Two values that indicate how the move operation went:


Playlist Items

A playlist item can contain the following fields: