HTTP API: Queue and play songs
#1
Question 
Maybe someone figures that out, I'm kinda stuck here. For our XBMC client for Android, I'm selecting arbitrarily songs which XBMC is supposed to play or queue. That can be a whole album, all songs from an artist, all songs of a genre, etc. Controls pass through the HTTP API.

In order to play song A, B, C (in that order), I imagined doing the following:

Code:
ClearPlayList(0)
AddToPlayList(A;0)
PlayFile(A;0)
AddToPlayList(B;0)
AddToPlayList(C;0)
[A, B, C being complete path names to the MP3 files]

Now, when I'm in XBMC, pressing space in the music library shows the playlist and shows indeed these three songs queued. Also, song A is playing.

BUT, only the first song plays. It stops playing before the second song. Apparently the PlayFile command only plays ONE single song and then stops. Is there a way to play the whole bunch? I studied the Wiki a while now, but I can't figure it out. Master jmarshall perhaps?

Cheers,

-freezy.
Running XBMC on my HTPC, tablet, phone and pinball machine.
Always read the XBMC online-manual, FAQ and search the forums before posting. Do NOT e-mail Team-XBMC members asking for support. For troubleshooting and bug reporting, make sure you read this first.
Reply
#2
AddToPlaylist and then maybe a PlaylistNext ?
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
Well, I tried:
Code:
ClearPlayList(0)
AddToPlayList(A;0)
PlaylistNext()
AddToPlayList(B;0)
AddToPlayList(C;0)
That queues ABC (expected) but it doesn't play anything at all (XBMC is stopped). But I just looked in the code and discovered AddToPlayListFromDB. That sounds promising!
Running XBMC on my HTPC, tablet, phone and pinball machine.
Always read the XBMC online-manual, FAQ and search the forums before posting. Do NOT e-mail Team-XBMC members asking for support. For troubleshooting and bug reporting, make sure you read this first.
Reply
#4
That's too weird, here was just someone asking the same question TODAY. I did some research the other day, believe me Smile
Running XBMC on my HTPC, tablet, phone and pinball machine.
Always read the XBMC online-manual, FAQ and search the forums before posting. Do NOT e-mail Team-XBMC members asking for support. For troubleshooting and bug reporting, make sure you read this first.
Reply
#5
Ah, figured it out. The trick is:
Code:
ClearPlayList(0)
AddToPlayList(A;0)
AddToPlayList(B;0)
AddToPlayList(C;0)
SetCurrentPlaylist(0)
PlaylistNext()

That plays it. Thanks for the hint Jonathan.
Running XBMC on my HTPC, tablet, phone and pinball machine.
Always read the XBMC online-manual, FAQ and search the forums before posting. Do NOT e-mail Team-XBMC members asking for support. For troubleshooting and bug reporting, make sure you read this first.
Reply
#6
Cool, glad you got it going!
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

Logout Mark Read Team Forum Stats Members Help
HTTP API: Queue and play songs0