Interfacing to VLC with Java

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
lloyd142

Interfacing to VLC with Java

Postby lloyd142 » 08 Nov 2005 18:44

Hi. There didn't seem to be any posts with any java code that demonstrated how to interface to VLC so I wrote some which seems to work. Hope you find it useful

Make sure you change the IP address, VLC.exe location and location of mdeia file to get it to work.

Code: Select all

import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; import java.net.UnknownHostException; public class SocketDemo { /** * @param args */ public static void main(String[] args) { try { Runtime.getRuntime().exec("C:/Program Files/VideoLAN/VLC/vlc.exe --extraintf=\"rc\" --rc-host=\"10.215.122.68:1234\" --rc-quiet"); Socket MyClient = new Socket("10.215.122.68", 1234); DataOutputStream output = new DataOutputStream(MyClient.getOutputStream()); final DataInputStream is = new DataInputStream(MyClient.getInputStream()); new Thread() { public void run() { String response; try { while ((response = is.readLine()) != null) { System.out.println("Server: " + response); } } catch (IOException e) { e.printStackTrace(); } } }.start(); output.writeBytes("add D:/music/Coldplay/A Rush of Blood to the Head/01 Politik.mp3"); output.writeBytes("\n"); output.writeBytes("play\n"); Thread.sleep(10000); output.writeBytes("quit\n"); } catch (UnknownHostException e) { System.out.println(e); } catch (IOException e) { System.out.println(e); } catch (InterruptedException e) { System.out.println(e); } } }

Guest

Postby Guest » 08 Nov 2005 21:58

You might want to check out the advene project source code as well. Check the README in modules\control\corba for URL, and the Corba client. I havn't managed to compiled the corba module though. You can find other info in the bindings directory too.

Guest

Postby Guest » 09 Nov 2005 10:14

You might want to check out the advene project source code as well. Check the README in modules\control\corba for URL, and the Corba client. I havn't managed to compiled the corba module though. You can find other info in the bindings directory too.
:arrow: :?:

Waruwaru
New Cone
New Cone
Posts: 5
Joined: 06 Nov 2005 03:13

Postby Waruwaru » 09 Nov 2005 22:15

You might want to check out the advene project source code as well. Check the README in modules\control\corba for URL, and the Corba client. I havn't managed to compiled the corba module though. You can find other info in the bindings directory too.
:arrow: :?:
Not sure what your :?: is?

The Advene source code has demonstrate a few different ways of controlling VLC (using native connection, http connections..etc).


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: Google [Bot] and 20 guests