Connect to VLC web interface?

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
vlc5463456758
New Cone
New Cone
Posts: 3
Joined: 11 Apr 2014 05:00

Connect to VLC web interface?

Postby vlc5463456758 » 11 Apr 2014 05:13

Ok I setup VLC for web interface. I can now access it using http://127.0.0.1:8080/

How can I setup PHP to send commands to VLC now? I want to be able to open files, seek, build playlist, pause, and adjust volume (all using my own PHP code).

I played around with this a year ago, and did some googling, but it appears things have changed. Think I used status.xml and browse.xml before, now those files do not even seem to appear. And now that VLC forces a password, it also throwns another monkey wrench into this (php would need to somehow connect using the password?).

The wiki is out dated. So no luck there. Can anyone help me out? By showing me some PHP code examples, or updated documentation on this?

edit: looks like its here:
http://127.0.0.1:8080/requests/status.xml
http://127.0.0.1:8080/requests/status.json
http://127.0.0.1:8080/requests/playlist.xml

etc.

I am using this resource: http://git.videolan.org/?p=vlc.git;a=bl ... xt;hb=HEAD

Ok, looks very good so far. I guess tomorrow ill just look at how to connect with the password (which im sure its possible).

vlc5463456758
New Cone
New Cone
Posts: 3
Joined: 11 Apr 2014 05:00

Re: Connect to VLC web interface?

Postby vlc5463456758 » 13 Apr 2014 04:26

ok, able to connect using PHP method called file_get_contents(), here is the code if anyone is curious (if nobody else uses this thread, I probably will in the future :P).In this example it sends an empty username and a password of "1234". The commented line is an example of a pause/play command being sent.
$context = stream_context_create(array(
'http' => array(
'header' => "Authorization: Basic " . base64_encode(":1234")
)
));
//$data = file_get_contents("http://127.0.0.1:8080/requests/status.x ... d=pl_pause", false, $context);
$data = file_get_contents("http://127.0.0.1:8080/requests/status.json", false, $context);

echo($data);
Very exciting. Looks like I can build some very powerful nifty personal PVR functionality here...

Seems the development team at VLC did a really great job with the VLC web interface.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 9 guests