requests/status.xml?command=pl_play&id

Discuss your Lua playlist, album art and interface scripts.
TDIger20
New Cone
New Cone
Posts: 5
Joined: 15 Apr 2019 20:07

requests/status.xml?command=pl_play&id

Postby TDIger20 » 20 Jun 2019 14:05

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

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

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

Postby unidan » 20 Jun 2019 14:55

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.

TDIger20
New Cone
New Cone
Posts: 5
Joined: 15 Apr 2019 20:07

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

Postby TDIger20 » 20 Jun 2019 19:26

Thanks for this answer!
Is there a way to figure out the ID or an other request command like Track-Number or so?

TDIger20
New Cone
New Cone
Posts: 5
Joined: 15 Apr 2019 20:07

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

Postby TDIger20 » 23 Jun 2019 22:21

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


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 5 guests