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)
...
◆ getPlayListId()
Function: getPlayListId()
Get the
PlayList Identifier
- Returns
- Id as an integer.
◆ add()
Function: add(url[, listitem, index])
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
..
◆ 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
-
filename | File with list to play inside |
- Returns
- False if unable to load playlist
◆ remove()
Function: remove(filename)
Remove an item with this filename from the playlist.
- Parameters
-
filename | The file to remove from list. |
◆ clear()
Function: clear()
Clear all items in the playlist.
◆ size()
Function: size()
Returns the total number of PlayListItems in this playlist.
- Returns
- Amount of playlist entries.
◆ shuffle()
Function: shuffle()
Shuffle the playlist.
◆ unshuffle()
Function: unshuffle()
Unshuffle the playlist.
◆ getposition()
Function: getposition()
Returns the position of the current song in this playlist.
- Returns
- Position of the current song