Thread Rating:
  • 1 Vote(s) - 5 Average
"Play next song automatically" in plugin - doable?
#1
I made a music plugin, is there any way to get the next song in the directory to play automatically when a song ends?
Reply
#2
XBMC will do that automatically assuming you have the option enabled.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
jmarshall Wrote:XBMC will do that automatically assuming you have the option enabled.

It doesn't seem to be working for me. I can queue the entire directory, but for some reason I can't get album art to show up when I do it that way.

I add my directories with:

Code:
def addDir(name,object_id,token,mode,iconimage):
        xbmc.log(name,xbmc.LOGNOTICE)
        u=sys.argv[0]+"?object_id="+str(object_id)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)+"&token="+token
        ok=True
        liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
        liz.setInfo( type="Music", infoLabels={ "Title": name } )
        ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
        return ok

and my links with:

Code:
def addLink(name,url,iconimage,node):
        ok=True
        liz=xbmcgui.ListItem(name, iconImage=iconimage, thumbnailImage=iconimage)
        liz.setInfo( type="Music", infoLabels={ "Title": node.findtext("title"), "Artist": node.findtext("artist"), "Album": node.findtext("album"), "TrackNumber": str(node.findtext("track")) } )
        ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
        return ok

Where url is of the type: http: //ampache-server.com/a/play.php?song=1000...

I think I'm missing something here.
Reply
#4
Hello,

Maybe you have to set the Music.AlbumArt since you're using InfoLabels?

Just an Idea not tested.

cu Nordish
Reply
#5
NordishByNature Wrote:Hello,

Maybe you have to set the Music.AlbumArt since you're using InfoLabels?

Just an Idea not tested.

cu Nordish

I can't find any reference to this in the documentation, can you clarify?
Reply
#6
actually jmarshall it doesn't auto-advance for plugins. the viewstate does not return autoplay...
Reply
#7
Thanks, spiff, I feel like slightly less of an idiot now Smile

While you're around, any clue about my thumbnail issue, i.e. thumbnails showing up when i open a (plugin) directory and play a link by itself but not when I queue the whole directory?
Reply
#8
In what cases would we not want autoplay? I can't think of any (for a music plugin).
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#9
none what so ever. it's a bug in my view
Reply
#10
fixed in r35433
Reply
#11
Thanks, spiff!
Reply
#12
Hi Spiff, i just installed r35744 and xbmc still doesn't play the next song automatically when the current one i selected ends. i made sure the option to play next song automatically is also selected in options.
could you pleaselook into this thanks.

spiff Wrote:fixed in r35433
Reply
#13
works fine for me in all add-ons. must be your end.
Reply
#14
I've also had no luck with this. During play, I'll see "Next:" pop up over the currently playing song title with nothing next to it.

Is there something specific I have to do to set the next song?

Code:
def addLinks(elem):
        ok=True
        li=[]
        for node in elem:
            liz=xbmcgui.ListItem(node.findtext("title").encode("utf-8"), iconImage=node.findtext("art"), thumbnailImage=node.findtext("art"))
            liz.setInfo( type="Music", infoLabels={ "Title": node.findtext("title").encode("utf-8"), "Artist": node.findtext("artist"), "Album": node.findtext("album"), "ReleaseDate": str(node.findtext("year")) } )
            tu= (node.findtext("url"),liz)
            li.append(tu)
        ok=xbmcplugin.addDirectoryItems(handle=int(sys.argv[1]),items=li,totalItems=len(elem))
        return ok
Reply
#15
I got it working by using SetResolvedURL.

I would like to know if it's possible to do it without SetResolvedURL as my current plugin doesn't really need it (AFAIK) and it introduces a redundant plugin call in between songs.
Reply



"Play next song automatically" in plugin - doable?51