[vlc] JVLC testing...

Javier Gálvez Guerrero javier.galvez.guerrero at gmail.com
Mon Aug 11 08:05:56 CEST 2008


Hi Tony,

2008/8/11 Tony Anecito <adanecito at yahoo.com>

> You need to add the canvas to the JFrame content pane.
>
> so add:
> frame.getContentPane().add(canvas);


I've tried this with no success, I get the same exception.

...
JFrame frame = new JFrame("VLCExample");
frame.setPreferredSize(new Dimension(225, 285));
frame.setResizable(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Canvas canvas = new Canvas();
frame.setLayout(new FlowLayout());
frame.getContentPane().add(canvas);  // Added

JVLC jvlc = new JVLC(args);
jvlc.setVideoOutput(canvas);  // Error here

frame.pack();
frame.setVisible(true);
...

However, note that the error appears when I try to set the JVLC output to
the canvas and I am forced to use a Canvas object so, as it has already been
created and added to the content pane, why does it fail with a "must be a
displayable component error"?



>
> Also, are you using the MediaPlayer class or the deprecated playlist class
> to play your video? I have had issues with support for the different video
> formats using the MediaPlayer class and wondering if others using that class
> are also having issues. Playlist works great for the different video formats
> but it is going away in the future.
>

I'm using the new MediaPlayer class. I have launched the VLC Example added
in the Java bindings branch of the VLC 0.9.0 test 3 version that uses this
class with no errors with a MPEG-1 and a H.264 videos. Hope this helps.


>
> Good luck.
> -Tony
>

Thank you for your time,
Javi

>
>
>
> --- On Sun, 8/10/08, Javier Gálvez Guerrero <
> javier.galvez.guerrero at gmail.com> wrote:
>
> > From: Javier Gálvez Guerrero <javier.galvez.guerrero at gmail.com>
> > Subject: Re: [vlc] JVLC testing...
> > To: "Mailing list for VLC media player users" <vlc at videolan.org>
> > Date: Sunday, August 10, 2008, 4:45 PM
> > Thanks, Keith. Now I'm able to launch a stand-alone VLC
> > window and play a
> > video.
> >
> > Now I'm trying to embed it into a Java Swing
> > application but it launches an
> > exception that I can't understand:
> >
> > ...
> >
> > JFrame frame = new JFrame("VLCExample");
> >         frame.setPreferredSize(new Dimension(225, 285));
> >         frame.setResizable(false);
> >
> > frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
> >
> >         Container cner = frame.getContentPane();
> >         cner.setLayout(new BoxLayout(cner,
> > BoxLayout.Y_AXIS));
> >
> >         JPanel panel = new JPanel();
> >         Canvas canvas = new Canvas();
> >         frame.setLayout(new FlowLayout());
> >         JVLC jvlc = new JVLC(args);
> >         jvlc.setVideoOutput(canvas); ---> // Exception
> > in thread "main"
> > java.lang.IllegalStateException: Component must be
> > displayable
> >         panel.add(canvas);                // at
> > com.sun.jna.Native.getComponentID(Native.java:159)
> >         cner.add(panel);                  // at
> > org.videolan.jvlc.JVLC.setVideoOutput(JVLC.java:90)
> >                                           // at
> > test.JVLCTest.main(JVLCTest.java:47)
> >         frame.pack();
> >         frame.setVisible(true);
> >
> > ...
> >
> > Any idea or sample to guess how to embed a JVLC window in a
> > Java Swing
> > application?
> >
> >
> > By the way, now that the 0.9.0 version of VLC is to come in
> > following days,
> > is going to appear any kind of documentation like a Javadoc
> > in JVLC site?
> >
> > And, as VLM setup has changed quite a lot since it seems
> > that there's no
> > need of interact with the telnet interface anymore (with a
> > lot of new
> > improvements I suppose), will the VLC official
> > documentation be updated in
> > the following weeks due to this new version release?
> >
> >
> > Thank you a lot,
> > Javi
> >
> >
> >
> > 2008/8/7 Keith Kyzivat <kkyzivat at tripleplayint.com>
> >
> > > I checked this out only a few weeks ago, and unless
> > things radically
> > > changed, the latest JVLC code is present there.
> > >
> > > Ahh, I see, you're looking at
> > >
> > bindings/java/samples/client/src/main/java/VlcClient.java .
> > I never tried
> > > that one.
> > >
> > > Give the example that exists in the core heirarchy a
> > try:
> > >
> >
> bindings/java/core/src/main/java/org/videolan/jvlc/example/VLCExample.java
> > >
> > > Just make sure you either change the path to the file
> > that it's looking
> > > for, or make the path it is looking for and stick a
> > media file there:
> > > /home/carone/apps/a.avi
> > >
> > > And for the record, jvlc-core-<version>.jar,
> > along with jna-3.0.2.jar are
> > > indeed needed in order for JVLC to work -- No longer
> > is jvlc.dll needed (I
> > > think that's what it was..) -- which were the old
> > JNI-based bindings.
> > >
> > > I have a co-worker who is working on some JVLC code,
> > but outside of my
> > > preliminary work to get JVLC building and the example
> > (and a nicer fixed up
> > > version) running properly, I have not used JVLC
> > extensively.
> > >
> > >
> > >
> > > On Thu, Aug 7, 2008 at 6:22 AM, Javier Gálvez
> > Guerrero <
> > > javier.galvez.guerrero at gmail.com> wrote:
> > >
> > >> Thank you for your answer, Keith, but the sample
> > in this git directory
> > >> (VlcClient.java) is the same I tried out before,
> > which uses deprecated
> > >> classes and methods from old VLC libraries and
> > doesn't work properly (it
> > >> hangs while trying to start playing a video file).
> > >>
> > >> That's why asked for any code written by any
> > user who used the new library
> > >> so I could guess how to implement my own
> > application based on JVLC.
> > >>
> > >>
> > >> Any help would be much appreciated.
> > >> Javi
> > >>
> > >>
> > >> 2008/8/6 Keith Kyzivat
> > <kkyzivat at tripleplayint.com>
> > >>
> > >> Check out the VLC source from git using the
> > following URL: git://
> > >>> git.videolan.org/vlc.git
> > >>>
> > >>> In there you will find a bindings/java
> > directory -- That is where the
> > >>> jvlc code is (it's an Apache Maven
> > project), In there you'll find some
> > >>> examples.
> > >>>
> > >>> More info on checking out the source can be
> > had here:
> > >>>
> > >>> http://wiki.videolan.org/GetTheSource
> > >>>
> > >>>
> > >>> On Wed, Aug 6, 2008 at 9:49 AM, Javier Gálvez
> > Guerrero <
> > >>> javier.galvez.guerrero at gmail.com> wrote:
> > >>>
> > >>>> Hi,
> > >>>>
> > >>>> Thank you for your answer, Gregor. It
> > worked properly with the nightlies
> > >>>> VLC version.
> > >>>>
> > >>>> By the way, could anyone provide me with
> > any little sample code in order
> > >>>> to guess how to use the JVLC methods to be
> > able to embed a video playing
> > >>>> frame into a Java JFrame or a similar
> > Swing component? I have tried to do it
> > >>>> with the sample code included in JVLC site
> > but it uses the deprecated
> > >>>> methods from old JVLC libraries.
> > >>>>
> > >>>> Thank you so much,
> > >>>> Javi
> > >>>>
> > >>>>
> > >>>> 2008/8/5 Gregor Fuis
> > <gujs.lists at gmail.com>
> > >>>>
> > >>>>>  You have to use vlc 0.9.0-test3 for
> > using this jvlc jar. Look at this
> > >>>>> site how to install it:
> > >>>>> http://nightlies.videolan.org/
> > >>>>>
> > >>>>> You
> > >>>>>
> > >>>>>
> > ______________________________________________________
> > >>>>> vlc mailing list
> > >>>>> To unsubscribe or modify your
> > subscription options:
> > >>>>>
> > http://mailman.videolan.org/listinfo/vlc
> > >>>>>
> > >>>>>
> > >>>>
> > >>>>
> > ______________________________________________________
> > >>>> vlc mailing list
> > >>>> To unsubscribe or modify your subscription
> > options:
> > >>>> http://mailman.videolan.org/listinfo/vlc
> > >>>>
> > >>>>
> > >>>
> > >>>
> > >>> --
> > >>> Keith Kyzivat
> > >>>
> > >>> SIPez LLC.
> > >>> SIP VoIP, IM and Presence Consulting
> > >>> http://www.SIPez.com
> > >>> tel: +1 (617) 273-4000
> > >>>
> > >>>
> > ______________________________________________________
> > >>> vlc mailing list
> > >>> To unsubscribe or modify your subscription
> > options:
> > >>> http://mailman.videolan.org/listinfo/vlc
> > >>>
> > >>>
> > >>
> > >>
> > ______________________________________________________
> > >> vlc mailing list
> > >> To unsubscribe or modify your subscription
> > options:
> > >> http://mailman.videolan.org/listinfo/vlc
> > >>
> > >>
> > >
> > >
> > > --
> > > Keith Kyzivat
> > >
> > > SIPez LLC.
> > > SIP VoIP, IM and Presence Consulting
> > > http://www.SIPez.com
> > > tel: +1 (617) 273-4000
> > >
> > > ______________________________________________________
> > > vlc mailing list
> > > To unsubscribe or modify your subscription options:
> > > http://mailman.videolan.org/listinfo/vlc
> > >
> > >
> > ______________________________________________________
> > vlc mailing list
> > To unsubscribe or modify your subscription options:
> > http://mailman.videolan.org/listinfo/vlc
>
>
>
> ______________________________________________________
> vlc mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc/attachments/20080811/e46fb852/attachment.html>


More information about the vlc mailing list