2016-04-01, 03:32
I would like to create add-on which has lots of streams in a playlist. But it needs to show in a playlist I can be able to click any of stream from playlist. and then while I play a stream and when I click skip button it needs to go to next stream, previous button then it needs to go to previous stream. How can I do this?
I have tried this. This will start playing from 1st stream and I can go from there. But I cannot show the list and select stream from there.
for example I have 20 streams in nameandsource variable. variable "i" is an index file and I would like to start playing from 5th stream. if I press « then it should play 4th stream like that.
please help me.
thank you
I have tried this. This will start playing from 1st stream and I can go from there. But I cannot show the list and select stream from there.
Code:
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.clear()
i = 0
for name, source in nameandsource:
source = 'http://example.com/'+source
listitem = xbmcgui.ListItem(name, thumbnailImage='http://example.com/'+img)
listitem.setInfo( type="Video", infoLabels={ "Title": name})
listitem.setProperty('mimetype', 'audio/mpeg')
listitem.setProperty( "Fanart_Image", 'http://example.com/img.jpg' )
listitem.setProperty('IsPlayable', 'true')
playlist.add(source, listitem)
i = i+1
xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(playlist)
for example I have 20 streams in nameandsource variable. variable "i" is an index file and I would like to start playing from 5th stream. if I press « then it should play 4th stream like that.
please help me.
thank you