2017-01-31, 16:08
great guys
(2017-06-02, 19:04)jaywidanem Wrote: It's 2017 now and im checking the updated code in github. I noticed that for this example, setArt is called once the ListItem is created. What if I don't have those information / data yet (image url)? when do i call setArt() ?
(2017-06-02, 23:45)Roman_V_M Wrote: If you are creating your media listing, it is assumed that you have gathered all possible information by then.
listitem.setSubtitles(['special://temp/example.srt', 'http://example.com/example.srt'])
(2017-10-23, 23:16)Gama41 Wrote: Thanks for this tutorial, it's really great !
It has almost everything I want to do in it, I want to add one more option to the list of the videos : subtitles !
So I searched the function I can use for that and I found this :
Code:listitem.setSubtitles(['special://temp/example.srt', 'http://example.com/example.srt'])
I don't understand the first parameter, if you can help me please it will be really great !
This tutorial is really awesome, hope I can add more features to my very first Kodi plugin !
# Iterate through categories
for category in categories:
# Create a list item with a text label and a thumbnail image.
list_item = xbmcgui.ListItem(label=category, thumbnailImage=VIDEOS[category][0]['thumb'])
# Set a fanart image for the list item.
# Here we use the same image as the thumbnail for simplicity's sake.
list_item.setProperty('fanart_image', VIDEOS[category][0]['thumb'])
icons = ++1
list_item = xbmcgui.ListItem(label=category, thumbnailImage='special://home/addons/plugin.video.myaddon/resources/icon' + str(icons) + '.png')
.
.
.
categories = get_categories()
numbers = [0, 1, 2]
# Iterate through categories
for category, number in zip(categories, numbers):
# Create a list item with a text label and a thumbnail image.
list_item = xbmcgui.ListItem(label=category)
# Set graphics (thumbnail, fanart, banner, poster, landscape etc.) for the list item.
# Here we use the same image for all items for simplicity's sake.
# In a real-life plugin you need to set each image accordingly.
list_item.setArt({'thumb': 'special://home/addons/plugin.video.myaddon/resources/icon' + str(number) + '.png',
'icon': 'special://home/addons/plugin.video.myaddon/resources/icon' + str(number) + '.png',
'fanart': 'special://home/addons/plugin.video.myaddon/resources/media/background.jpg'})
.
.
.
python:xbmc.executebuiltin('Container.SetViewMode(57)')
python:xbmcplugin.endOfDirectory(__handle__)