Playlist Queue All
#1
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)
Reply
#2
Here are your options -> http://mirrors.xbmc.org/docs/python-docs...tml#Player

If you do -
Code:
xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(pl)
it's much faster.

The default or auto will choose paplayer for mp3s, I agree it is slow for streaming. Seems as if the file needs to finish downloading before it starts to play.

Does anyone know if there is a way to set the player_core in a plugin directory item or some other way when not calling the player directly?

I don't think you want to build the playlist in your addLink function, if your adding multiple items in a loop the playlist will get cleared every time you addLink.

You could try something like this -
Code:
pl=xbmc.PlayList(1)
pl.clear()
for x in y:
    addLink1(name,url,iconimage)
xbmc.Player().play(pl)

def addLink1(name,url,iconimage):
        ok=True
        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
Reply
#3
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
Reply
#4
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
Reply
#5
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()
Reply
#6
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


waaahhhhhHuh?? !!!!
Reply
#7
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.
Reply

Logout Mark Read Team Forum Stats Members Help
Playlist Queue All 0