Share My Creation B4J with embedded VLC

Once again I am playing around with B4J and this time I have started a project to embed VLC (videolan).
So far it is very basic and there are lots of things to check and test.
Anyway, B4J is really powerful and a joy to work with....

Here is a video:
 
Last edited:

moster67

Expert
Licensed User
Longtime User
Added a new video in the first post (something went wrong with my YouTube upload of the first video).
 

moster67

Expert
Licensed User
Longtime User
Just an update.
Got most stuff working (resizing, drag & drop etc).
Many thanks to @Daestrum who helped me out to resolve a stupid oversight but which was blocking the progress to get the videoview resizeable.
Now, I just need to sort out some discovery stuff (finding vlc-libs on all platforms).
When ready, I will post the app-code and the B4JVlcj-library.
Here is a teaser:

 

moster67

Expert
Licensed User
Longtime User
Ok, I have now published the B4JVlcj-library.
You can find the library and the code for the demo-app showed in above videos here.

You can download above DemoApp as a jar-file here.

I have tried it on Windows 10 and on my MAC and it works fine.
It would be great if someone could try the jar-file on a Linux-box and let me know if it works.
On Windows, you may need to run the jar-file from a command-line as follows:
java -jar vlcj.jar
unless you make a standard executable of the jar-file.

PS: VLC (VideoLAN) must be installed on your computer.
 
Last edited:

dieterp

Active Member
Licensed User
Longtime User
Thank you very much for this project. It is extremely handy for my purposes! I have managed to get the demo app you provided a link for to work on Windows. When I run it on a Mac though I am getting the following error when launching through the Terminal. I have installed VLC (64x) onto the Mac (64x) which is running OS 9.1:

B4X:
Edwards-MBP:downloads edward$ java -jar vlcj.jar
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
main._appstart (java line: 79)
java.lang.UnsatisfiedLinkError: Unable to load library 'vlc': Native library (darwin/libvlc.dylib) not found in resource path (vlcj.jar)

Do you have any idea what could be causing the issue?
 

moster67

Expert
Licensed User
Longtime User
Hmm...
OS9.1. sounds very old - early 2001 or similar.
If yes, I am unsure it will run on such an old OS. I believe VLC media player requires at least Mac OS X 10.7 unless you use an older version compiled for PowerPC.
Or did I get you wrong?
 

moster67

Expert
Licensed User
Longtime User
In any case, it seems like VLC cannot be found. Did you install it in the standard folder "../Applications"?
If not, try it there.
 

dieterp

Active Member
Licensed User
Longtime User
I was getting someone else to test on their Mac so I'm not 100% sure about the procedure they followed. I'm going to find someone with a more updated version of OSX and see what comes from that. I will report back with my findings.
 

dieterp

Active Member
Licensed User
Longtime User
Ok, here is some feedback on what we've discovered on testing on different OS:

MAC
1) We upgraded the OSX to version 10.13.4 and were still encountering the issue listed above
2) We then downgraded VLC to version 2.5 (From 3.2) and it works perfectly with that
3) It seems that the latest version of VLC 3.2 seems to be creating issues. The links https://github.com/caprica/vlcj/issues/602 and https://stackoverflow.com/questions/21066731/cannot-fix-vlcj-load-library-libvlc provide more detail

Windows
1) Everything works fine on Windows, even with version 3.2 of VLC
2) What I did however find is that VLC 3.2 takes very long to load the video. Downgrading to VLC 2.8 loads the video instantly, and also jumps between different videos seamlessly
 

moster67

Expert
Licensed User
Longtime User
I don't remember which was the current version of VLC when I wrapped vlcj but it worked fine and was very fast.
Are you trying just the stand-alone jar or are you trying by using a B4J-project?
Part of the the java-sources are available in the library thread. If you want me to take a look at it, please let me know by PM as I suggested in the same thread.
 

dieterp

Active Member
Licensed User
Longtime User
We are using just the jar file to test on Mac but I'm using the B4J project to test on Windows. I did also test the jar file on Windows and it displayed the same characteristics as the B4J project (Where both loaded the video slowly with VLC 3.2).

I'm going to play around with things a bit more this week and then contact you via PM to discuss the java-sources. Thanks again for this. Great job!
 

moster67

Expert
Licensed User
Longtime User
Had a look at my Mac (remotely) and noted that I still have version 2.2.4 of VLC installed and it works fine.
Probably, as you say, with more recent versions of VLC, there might be some problems although I did not test to upgrade VLC since I am not at home in this moment.
 
Top