Page 1 of 1

VLCJ Lib <plugins-path> issue

Posted: 22 Apr 2013 16:59
by aneeshsebastian
I face a big trouble at the end of my development. My assumptions went wrong.

My requirement is 'Run VLCJ without installing VLC player locally'.

After spending time to understand VLCJ API, I came to know that It must be possible. So I created a custom native-lib.jar with following dlls.

libvlccore.dll
libvlc.dll
/plugins/.... (This contains every plugins)

I load the library using :

System.loadLibrary("libvlccore");
System.loadLibrary("libvlc");

For my development environment, I dynamically set java.library.path to a directory which extracts the content of my custome native-lib.jar. This works fine. Finally, end users of this application use JNLP in order to launch this application.I was sure <nativelib download="eager" href="lib/native-lib.jar"/> will loads vlcj lib to java.library.path. Yes it does. But the big mess is VLCJ API could not load /plugin from native-lib.jar. It says :

In the text below <libvlc-path> represents the name of the directory containing "libvlc.dll" and "libvlccore.dll" and <plugins-path> represents the name of the directory containing the vlc plugins...

For libvlc to function correctly the vlc plugins must be available, there are a number of different ways to achieve this:
1. Make sure the plugins are installed in the "<libvlc-path>/plugins" directory, this should be the case with a normal vlc installation.
2. If using vlc 1.2.x, include System.setProperty("VLC_PLUGIN_PATH", "<plugins-path>"); at the start of your application code.
3. If using vlc 1.2.x, specify -DVLC_PLUGIN_PATH=<plugins-path> on the command-line when starting your application.
4. If using vlc 1.1.x, pass "--plugin-path=<plugins-path>" as parameters in your application code when you create a MediaPlayerFactor


Means /plugins not loaded. How can we set plugin directory dynamically? If i set the --plugin-path parameter as a absolutel path ,which means that i put all the plugin dll files at the client side, everthing is ok. But this is not what I wanted to achieve. I should be able to supply plugins from a native jar. If I could load "libvlc.dll" and "libvlccore.dll" successfully at run time. There must be a way to load /plugins as well.

I expect your prompt reply as I am in big trouble.

Re: VLCJ Lib <plugins-path> issue

Posted: 22 Apr 2013 17:12
by sherington
I expect your prompt reply as I am in big trouble.
I'll get right on it, hold on...

Re: VLCJ Lib <plugins-path> issue

Posted: 22 Apr 2013 17:26
by Rémi Denis-Courmont
I am not aware of any way for native code (such as libvlccore) to load native libraries from within a ZIP file (such as .JAR). If you want to store VLC run-time entirely in a JAR file, you have basically three options:
  • Extract all required files manually before you instantiate libvlc.
  • Link libvlc statically with all useful plugins and give up on any features that would require external data files (notably the Lua scripts).
  • Teach libvlc to load plugins from a .ZIP file.
The last two options will require some native development as libvlc does not support such operations at the moment.

Re: VLCJ Lib <plugins-path> issue

Posted: 23 Apr 2013 07:35
by aneeshsebastian
"The last two options will require some native development as libvlc does not support such operations at the moment."

Do you think future versions of VLCJ will support these features? This is something a primary requirement that VLCJ Plugins should be dynamically available.

Re: VLCJ Lib <plugins-path> issue

Posted: 23 Apr 2013 07:49
by sherington
"The last two options will require some native development as libvlc does not support such operations at the moment."

Do you think future versions of VLCJ will support these features? This is something a primary requirement that VLCJ Plugins should be dynamically available.
I don't see how that can be done in vlcj, vlcj is not involved in loading those plugins.

You *can* use vlcj without vlc being installed. You unpack your jar/zip containing ALL of the native libraries and point vlcj at that.

Whether you can do that Webstart's inbuilt native library mechanism is another matter.

Re: VLCJ Lib <plugins-path> issue

Posted: 23 Apr 2013 17:31
by Rémi Denis-Courmont
Do you think future versions of VLCJ will support these features?
That is outside the scope of VLCJ. As said, that would entail native development within VLC proper. Whether it will ever be done is largelly dependant on whether someone will put the implied time investment.