VLCJ Lib <plugins-path> issue

This forum is about all development around libVLC.
aneeshsebastian
Blank Cone
Blank Cone
Posts: 18
Joined: 16 May 2011 08:03

VLCJ Lib <plugins-path> issue

Postby aneeshsebastian » 22 Apr 2013 16:59

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.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: VLCJ Lib <plugins-path> issue

Postby sherington » 22 Apr 2013 17:12

I expect your prompt reply as I am in big trouble.
I'll get right on it, hold on...

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLCJ Lib <plugins-path> issue

Postby Rémi Denis-Courmont » 22 Apr 2013 17:26

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

aneeshsebastian
Blank Cone
Blank Cone
Posts: 18
Joined: 16 May 2011 08:03

Re: VLCJ Lib <plugins-path> issue

Postby aneeshsebastian » 23 Apr 2013 07:35

"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.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: VLCJ Lib <plugins-path> issue

Postby sherington » 23 Apr 2013 07:49

"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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLCJ Lib <plugins-path> issue

Postby Rémi Denis-Courmont » 23 Apr 2013 17:31

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 6 guests