Page 1 of 1

Controlling VLC from FoxyTunes

Posted: 07 Sep 2004 22:18
by iosart
My name is Alex Sirota and I am the author of a Firefox extension called FoxyTunes, which allows the users to control their media players from Firefox.

http://www.iosart.com/foxytunes/firefox/

I received many user requests to add VLC support.

I've looked at the different VLC control interfaces and didn't find one that I can use naturally:
1. rc/command line - not very efficient for automation from C++
2. http - no way (I think) to get track info etc. without changing user's installation, need to simulate http session from C++
3. telnet - doesn't seem to have all the options.
4. corba - no windows support (?)

I need a simple way to perform basic control functions - play/pause etc, and get the basic info about the currently playing track - name/position/length etc.

Am I overlooking something? Is there a client C/C++ code somewhere that is multiplatform and does something similar?

Thanks,
Alex

Posted: 08 Sep 2004 14:45
by The DJ
The HTTP interface can do this btw in the next version...
Beyond that i don't see another possibility, but as always I advise you to drop in on the IRC channel and/or join the vlc-devel mailinglist.

Posted: 28 Oct 2004 07:48
by iosart
The HTTP interface can do this btw in the next version...
Is the next version out already?
If so, can you please demonstrate how to get the track title through this interface?

If no, can you please tell me when it will be out?

Thanks :)

Posted: 15 Nov 2004 18:17
by chaosfive
These files work with 0.8.0 of VLC, and need to be in the VLC\http directory.

To fetch information in 'name\nvalue\n' format (great for hash bindings):

Code: Select all

<vlc id="foreach" param1="cat" param2="information" /><vlc id="foreach" param1="info" param2="cat.info" /><vlc id="value" param1="info.name" /> <vlc id="value" param1="info.value" /> <vlc id="end" /><vlc id="end" />
To fetch state information (current position, status, etc):

Code: Select all

<vlc id="value" param1="stream_state" /> <vlc id="value" param1="stream_time" /> <vlc id="value" param1="stream_length" /> <vlc id="value" param1="volume" />
Save them to something like 'tags.html' and 'state.html' in the VLC\http directory, and start VLC with '--extra-intf=http' (alternatively for a headless session, '--intf=http')

I also recommend replacing the default index.html with an empty file for speed reasons: index.html is returned on every control query and a long, complicated index can be problematic.

I've been using the http interface to build a Python control structure, but it's somewhat slower than I'd like. I'm trying to get the CORBA interface to work on Windows, but I've had minimal success so far.

For controlling the player and getting playlist data, look in 'http\index.html' --- the examples are all fairly straightforward.

For example, to pause the stream, issue a request to:

Code: Select all

http://localhost:8080/?control=pause
I'm open sourcing my work on the Python bindings once they're stable: e-mail me and I'll send you what I have so far. It works reasonably well, but it's rather messy.

Posted: 15 Nov 2004 18:48
by iosart
Thanks a lot! :)

One question - I was trying to get information out of VLC -without- modifying user's installation (like the httpd directory).

The DJ said
The HTTP interface can do this btw in the next version...


Is this indeed possible in the new version?
If so, how?

Posted: 15 Nov 2004 20:44
by Sigmund
provide these files with your app, and lounch vlc with --intf http --http-src=<path to the files>

Posted: 15 Nov 2004 20:51
by iosart
provide these files with your app, and lounch vlc with --intf http --http-src=<path to the files>
Thanks, this is a nice solution.
There is one problem - sometimes the user will launch the player and not me - I cannot really control that...

Actually I was looking for something like:

Code: Select all

http://localhost:8080/?get=current_track_name
That will just return the info without needing special additional files.

I'm not sure this can be done though...

Re: Controlling VLC from FoxyTunes

Posted: 21 Aug 2007 11:22
by shura