Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

Kodi's Play List class. More...

Classes

class  XBMCAddon::xbmc::PlayList
 

Functions

 XBMCAddon::xbmc::PlayList::getPlayListId ()
 

Function: getPlayListId()


Get the PlayList Identifier
 
 XBMCAddon::xbmc::PlayList::add (...)
 

Function: add(url[, listitem, index])


Adds a new file to the playlist.
 
 XBMCAddon::xbmc::PlayList::load (...)
 

Function: load(filename)


Load a playlist.
 
 XBMCAddon::xbmc::PlayList::remove (...)
 

Function: remove(filename)


Remove an item with this filename from the playlist.
 
 XBMCAddon::xbmc::PlayList::clear ()
 

Function: clear()


Clear all items in the playlist.
 
 XBMCAddon::xbmc::PlayList::size ()
 

Function: size()


Returns the total number of PlayListItems in this playlist.
 
 XBMCAddon::xbmc::PlayList::shuffle ()
 

Function: shuffle()


Shuffle the playlist.
 
 XBMCAddon::xbmc::PlayList::unshuffle ()
 

Function: unshuffle()


Unshuffle the playlist.
 
 XBMCAddon::xbmc::PlayList::getposition ()
 

Function: getposition()


Returns the position of the current song in this playlist.
 

Detailed Description

Kodi's Play List class.

Class: xbmc.PlayList(playList)

To create and edit a playlist which can be handled by the player.

Parameters
playList[integer] To define the stream type
Value Integer String Description
0 xbmc.PLAYLIST_MUSIC Playlist for music files or streams
1 xbmc.PLAYLIST_VIDEO Playlist for video files or streams

Example:

...
play=xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
...

Function Documentation

◆ add()

void XBMCAddon::xbmc::PlayList::add ( ...)

Function: add(url[, listitem, index])


Adds a new file to the playlist.

Parameters
urlstring or unicode - filename or url to add.
listitem[opt] listitem - used with setInfo() to set different infolabels.
index[opt] integer - position to add playlist item. (default=end)
Note
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.

Example:

..
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
video = 'F:\\movies\\Ironman.mov'
listitem = xbmcgui.ListItem('Ironman', thumbnailImage='F:\\movies\\Ironman.tbn')
listitem.setInfo('video', {'Title': 'Ironman', 'Genre': 'Science Fiction'})
playlist.add(url=video, listitem=listitem, index=7)
..

◆ clear()

void XBMCAddon::xbmc::PlayList::clear ( )

Function: clear()


Clear all items in the playlist.

◆ getPlayListId()

XBMCAddon::xbmc::PlayList::getPlayListId ( )

Function: getPlayListId()


Get the PlayList Identifier

Returns
Id as an integer.

◆ getposition()

int XBMCAddon::xbmc::PlayList::getposition ( )

Function: getposition()


Returns the position of the current song in this playlist.

Returns
Position of the current song

◆ load()

bool XBMCAddon::xbmc::PlayList::load ( ...)

Function: load(filename)


Load a playlist.

Clear current playlist and copy items from the file to this Playlist filename can be like .pls or .m3u ...

Parameters
filenameFile with list to play inside
Returns
False if unable to load playlist

◆ remove()

void XBMCAddon::xbmc::PlayList::remove ( ...)

Function: remove(filename)


Remove an item with this filename from the playlist.

Parameters
filenameThe file to remove from list.

◆ shuffle()

void XBMCAddon::xbmc::PlayList::shuffle ( )

Function: shuffle()


Shuffle the playlist.

◆ size()

int XBMCAddon::xbmc::PlayList::size ( )

Function: size()


Returns the total number of PlayListItems in this playlist.

Returns
Amount of playlist entries.

◆ unshuffle()

void XBMCAddon::xbmc::PlayList::unshuffle ( )

Function: unshuffle()


Unshuffle the playlist.