VLCj Java Applet - No Video on Mac

This forum is about all development around libVLC.
sonicBadger
New Cone
New Cone
Posts: 4
Joined: 07 Sep 2012 12:31

VLCj Java Applet - No Video on Mac

Postby sonicBadger » 07 Sep 2012 15:07

First off, this is a VLCj problem. I am not sure if this is the right place really for VLCj problems but I don't know where else to go.

The problem I am having is that I have constructed a Java Applet that uses VLCj to displays a video that is being multicast out (from VLC btw). This applet works correctly on Linux, Windows but my pesky Mac mini doesn't display the video. It only plays the sound.

On the Mac, when I run the Java applet in Eclipse I see the video and the hear the audio. Just when I open the Applet in any browser I get only audio and a big black square.
So I am wondering if it is a signing issue on the mac. The Java applet plus the VLCj jar files must be signed is my understanding. I do get the dialogue box asking to approve the applet on the Mac like with Windows & Linux. But unlike Windows & Linux, the approve dialogue box appears 5 times instead of once.

The theory I had is maybe I am using the wrong VLCj function. I use the EmbeddedMediaPlayerComponent() Maybe I should be using a different VLCj function.

If anyone has any idea what could be possibly happening I would be very appreciative.

If you want to see the code or anything let me know. I also need to put my code into GitHub as VLCj is GPL. Just need to work out how to use Git and GitHub.

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 Java Applet - No Video on Mac

Postby sherington » 07 Sep 2012 16:39

On the Mac, when I run the Java applet in Eclipse I see the video and the hear the audio. Just when I open the Applet in any browser I get only audio and a big black square.
So I am wondering if it is a signing issue on the mac.
If it were a signing issue, you wouldn't hear audio either. So if audio works, your jars are signed correctly.
The Java applet plus the VLCj jar files must be signed is my understanding.
Correct, also the JNA jar files too.
I do get the dialogue box asking to approve the applet on the Mac like with Windows & Linux. But unlike Windows & Linux, the approve dialogue box appears 5 times instead of once.
I don't know why you get it 5 times. Presumably you are self-signing? If you use a 'proper' certificate issued by a CA, that problem should go away.
The theory I had is maybe I am using the wrong VLCj function. I use the EmbeddedMediaPlayerComponent() Maybe I should be using a different VLCj function.
Nope, you seem to be doing the right thing. Especially since it is working for you on other platforms.

Maybe the Java plugin in your browser is using a different version of Java than the one you are using in Eclipse, so you could check that.

I would also say make sure you are using latest JDK (at least the most up-to-update Java6 platform, or Java7). And make sure you are using the latest vlc. Also, try and find any logs emitted by the Java plugin in your browser and see if there's anything in there.
If you want to see the code or anything let me know. I also need to put my code into GitHub as VLCj is GPL. Just need to work out how to use Git and GitHub.
I think you only need to make an offer to distribute your code to whomever you distribute vlcj to. There's nothing says you have to put your own code on Github.

vlcj is not developed/tested on Mac at all, but users have reported it works with latest vlc. I don't recall any Mac users using vlcj with Java applets or not.

sonicBadger
New Cone
New Cone
Posts: 4
Joined: 07 Sep 2012 12:31

Re: VLCj Java Applet - No Video on Mac

Postby sonicBadger » 07 Sep 2012 18:30

Thanks for the reply sherington, i really appreciate it.

I just made a quick java applet that showed what was the current runtime JVM Version "System.getProperty("java.runtime.version")" and i tested it on all of my comps. Each one is running a different version of Java. But importantly on the Mac, the JVM in Eclipse was the same version and arch type as the the one running in the web browser. So kinda confusing why Eclipse works and the web browser doesn't. Going to test it on my macbook in abit and see what happens.

I tired the code with 32bit vlc and JVM and also with 64bit vlc and JVM. (keeping the arch of the JVM inline with the VLC arch). But same result both times.

As for logging. Nothing is displayed on the Java console but i haven't turned on VLC logging. Going to add that code in and see what appears.

I understand I probably am the only one messing around with VLCj this way. It is a pretty strange method.

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 Java Applet - No Video on Mac

Postby sherington » 07 Sep 2012 19:58

In a static block in your applet class somewhere, do System.setProperty("vlcj.log, "DEBUG") as well.

I have applets working on Linux, as you do, but I don't have access to Mac hardware to test so I'm afraid I can't help much more.

By the way, have you tried other browsers on your Mac?

sonicBadger
New Cone
New Cone
Posts: 4
Joined: 07 Sep 2012 12:31

Re: VLCj Java Applet - No Video on Mac

Postby sonicBadger » 17 Sep 2012 12:50

Sorry I have replied in a while.

I been testing this with different Mac OS X Versions (Leopard, Snow Leopard and Lion) and on the two Mac Books I have and the Mac Mini (turns out I seem to own a few Apple stuff). Interesting however, on one of the Mac Books I use Linux and it works fine. Boot into Mac OS X on the same Mac Book and it doesn't. Already knew this would be the case as it is a software issue not a hardware. But it was nice to see it anyway.

I also tested this with all the web browsers on the Mac and all get the same result. So now trying to work out why in AppletViewer it works and not in the browser.

I had a quick question? When you did the applet did you create a policy file and also which html tag did you use? I am using the <applet> tag which I hear is a bad move. But everything else throws up 'class not found exception' so defiantly not getting them right.

Also I post this issue to stack overflow. Maybe someone has had some experience with a similar issue before. Thanks for the help you have given.

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 Java Applet - No Video on Mac

Postby sherington » 17 Sep 2012 13:09

I had a quick question? When you did the applet did you create a policy file and also which html tag did you use? I am using the <applet> tag which I hear is a bad move. But everything else throws up 'class not found exception' so defiantly not getting them right.
I used Java WebStart and JNLP rather than an applet tag:

http://en.wikipedia.org/wiki/Java_Web_Start

As far as I can remember, I did not use any policy file.

When your applet fails on Mac, you need to see all the logs in the Java Console in the browser - the Java log itself and the vlcj logs. You must be doing everything else right because you have it working on other platforms.

I think you can do "javaws --viewer" to get to a UI that will allow you to force the Java Console to appear.

sonicBadger
New Cone
New Cone
Posts: 4
Joined: 07 Sep 2012 12:31

Re: VLCj Java Applet - No Video on Mac

Postby sonicBadger » 17 Sep 2012 17:06

Web start seems a better system. Just experimenting with it now. Thanks for the suggestion.

I did forget to mention. I get the logging data back in the Java Console. I also getting a message I am unsure about. The message is:
basic: Removed progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@5c95da38

The javaDocs list sun.plugin.util.GrayBoxPainter as "GrayBoxPainter is a helper class to paint the applet gray box with image and progress bar." So guessing that is the lovely box with the spinning icon you see before your applet has started.

So it probably is a red-herring. But i do only see that message on Mac in the browser and not on Linux, Windows. Which makes me think its appearance could be important.

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 Java Applet - No Video on Mac

Postby sherington » 19 Sep 2012 19:56

Can you successfully deploy and run a simple hello world applet/webstart on your Mac browser?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 11 guests