Kodi's Play List class.
More...
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)
...
◆ add()
void XBMCAddon::xbmc::PlayList::add |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> add(url[, listitem, index]) </big></font></span></code></h4> \endhtmlonly
Adds a new file to the playlist.
- Parameters
-
url | string 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)n
..
◆ clear()
void XBMCAddon::xbmc::PlayList::clear |
( |
| ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> clear() </big></font></span></code></h4> \endhtmlonly
Clear all items in the playlist.
◆ getPlayListId()
XBMCAddon::xbmc::PlayList::getPlayListId |
( |
| ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getPlayListId() </big></font></span></code></h4> \endhtmlonly
Get the PlayList Identifier
- Returns
- Id as an integer.
◆ getposition()
int XBMCAddon::xbmc::PlayList::getposition |
( |
| ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getposition() </big></font></span></code></h4> \endhtmlonly
Returns the position of the current song in this playlist.
- Returns
- Position of the current song
◆ load()
bool XBMCAddon::xbmc::PlayList::load |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> load(filename) </big></font></span></code></h4> \endhtmlonly
Load a playlist.
Clear current playlist and copy items from the file to this Playlist filename can be like .pls or .m3u ...
- Parameters
-
filename | File with list to play inside |
- Returns
- False if unable to load playlist
◆ remove()
void XBMCAddon::xbmc::PlayList::remove |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> remove(filename) </big></font></span></code></h4> \endhtmlonly
Remove an item with this filename from the playlist.
- Parameters
-
filename | The file to remove from list. |
◆ shuffle()
void XBMCAddon::xbmc::PlayList::shuffle |
( |
| ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> shuffle() </big></font></span></code></h4> \endhtmlonly
Shuffle the playlist.
◆ size()
int XBMCAddon::xbmc::PlayList::size |
( |
| ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> size() </big></font></span></code></h4> \endhtmlonly
Returns the total number of PlayListItems in this playlist.
- Returns
- Amount of playlist entries.
◆ unshuffle()
void XBMCAddon::xbmc::PlayList::unshuffle |
( |
| ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> unshuffle() </big></font></span></code></h4> \endhtmlonly
Unshuffle the playlist.