Page 1 of 1

requests/status.xml?command=pl_play&id

Posted: 20 Jun 2019 14:05
by TDIger20
I have two questions to this command:

I'm creating out of a database a XSPF playlist for the VLC and – same order and filter – a HTML page with thumbnails. I have now added an icon to the page where I want, that a click on it causes that the VLC jumps to that movie.

So the hyperlink in the HTML looks like:

Code: Select all

http://xxx.xxx.xxx.xx:8080/requests/status.xml?command=pl_play&id=100
Basically it works, but there are two problems:

There is an offset of 3 between the ID and the position in the play list, the command above will jump to position 97, if I want to jump to movie 100 I have to call 103. If this is a constant value, it would not be a problem to add simply 3 to 'my' ID to convert it for the hyper link, but somehow it's not plausible.

The more annoying issue is: Each time I click on such an icon the status is shown in the current window. Under HTML I can change the target for this window, but the main page loses it's focus.

How can I suppress the response from the VLC

Re: requests/status.xml?command=pl_play&id

Posted: 20 Jun 2019 14:55
by unidan
Hi,

For the first part, id and position are very different things. You can't assume that it will always be a constant 3 offset and I'm not even sure it's always the case (it's definitively not in vlc4.0).

For the second part, it seems unrelated to VLC but you could check what is done in the web interface, using a XMLHttpRequest.

Re: requests/status.xml?command=pl_play&id

Posted: 20 Jun 2019 19:26
by TDIger20
Thanks for this answer!
Is there a way to figure out the ID or an other request command like Track-Number or so?

Re: requests/status.xml?command=pl_play&id

Posted: 23 Jun 2019 22:21
by TDIger20
Found it (hopefully, for me it works):
Add to the XDPF the following:

Code: Select all

<track> ... <extension application="http://www.videolan.org/vlc/playlist/0"> ... <vlc:id>MyId</vlc:id> ... </extension> ... </track>
And to the HTML;

Code: Select all

... <A HRef=http://:xxx@xxx.xxx.xxx.xxx:8080/requests/status.xml?command=pl_play&id=MyId><Img Src="…"/></A> ...
Then you can use your own ID!

See https://wiki.videolan.org/index.php?title=XSPF&action=edit as reference