Posts: 347
Joined: Nov 2011
2012-08-22, 13:18
(This post was last modified: 2012-08-22, 13:50 by mikey1234.)
i have this in addlink
Code:
def addLink1(name,url,iconimage):
ok=True
pl=xbmc.PlayList(1)
pl.clear()
liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
liz.setInfo( type="Audio", infoLabels={ "Title": name})
liz.setProperty('mimetype', 'audio/mpeg')
xbmc.PlayList(1).add(url, liz)
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz,isFolder=False)
return ok
now the mp3s play all ok
but to add to playlist i have to right click queue item how can i automatically have all items queued when the directory is listed
what i dont want to do is add
Code:
xbmc.Player().play(pl)
as it just takes forever to load
is there not a
Code:
xbmc.Player().queue(pl)
Posts: 347
Joined: Nov 2011
yeah it is a bummer that it has to download the mp3 before playing wish there was a workaround
i have done this which works great basically taking out the .clear()
do you know of issues with taking it out only reason is there is no playlist with it in
and with having in addlink funtion
i have it like this as people are searching albums with it and it is the only album they will play until they search a new album
Code:
def addLink1(name,url,iconimage,fanart):
ok=True
pl=xbmc.PlayList(xbmc.PLAYLIST_MUSIC)
liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
liz.setInfo( type="Audio", infoLabels={ "Title": name})
liz.setProperty('mimetype', 'audio/mpeg')
liz.setProperty( "Fanart_Image", fanart )
pl.add(url, liz)
xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(pl)
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz,isFolder=False)
return ok
Posts: 347
Joined: Nov 2011
i have this working better
Code:
def addLink1(name,url,iconimage,fanart):
ok=True
pl=xbmc.PlayList(0)
liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
liz.setInfo("music", infoLabels={ "Title": name})
liz.setProperty('mimetype', 'audio/mpeg')
liz.setProperty( "Fanart_Image", fanart )
pl.add(url, liz)
xbmc.Player(xbmc.PLAYER_CORE_MPLAYER).play(pl)
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz,isFolder=False)
return ok
but only problem because of the .clear when searching for anothe album the first playlist i created will always have the first song stored how can i use .clear function to clear properly
as if i use ,clear i will not create a playlist at all
Posts: 347
Joined: Nov 2011
i have sorted this now basically the fucnction that calls the addlinks when selected i had it clear the playlist before the code ran again
Code:
def MUSIC_LIST_SEARCH(name, url):
xbmc.PlayList(0).clear()
Posts: 347
Joined: Nov 2011
strange thing really strange
if i have
Code:
liz.setInfo("music", infoLabels={ "Title": name})
changed to
Code:
liz.setInfo( type="Video"infoLabels={ "Title": name})
it will stream instead of download
waaahhhhh
?? !!!!
Posts: 1,355
Joined: Oct 2008
Reputation:
66
I think when you set type=video it uses the dvdplayer, look at your log, see which player opens the file. The problem with this is you cant set the proper music infolabels = 'artist, album, song, tracknumber' and such.