Video and Eclipse

March 3rd, 2009  |  Published in Rich Client Platform, Tips  |  6 Comments

For an upcoming project I need to be able to show Flash videos inside of an RCP application. Java has never been known for its multimedia functionality so I didn’t have very high hopes.

Fortunately, with Java Media Components things seem to be moving in the right direction. JMC is an API that allows you to play media files using the video functionality of the underlying operating system (there is work being done to provide cross-platform codecs along with the API, but it’s unclear how extensive this will be). JMC is distributed as part of the JavaFX platform, but it can function independently inside of a regular Swing application.

Using this recent article as a guide, I managed to create an Eclipse plug-in that contributes a very rudimentary video player view to Eclipse or any other RCP application. If you’d like to try it yourself, click here for the source code (exported project). Note that the current code only works on Windows.

Video playing inside the Eclipse IDE

Above you can see a Flash video of Wipeout playing inside of my Eclipse IDE. Wipeout is my 5-year old daughter’s favorite show (if people are falling down, she’s laughing), so after 20 years as a software developer I’ve finally written some code she’d be interested in!

One thing to note is that JMC relies on the codecs installed on your machine. There have been some complaints that JMC is not finding or utilizing the codecs most people have installed, and hopefully this situation will improve. If you find that you’re getting MediaUnsupportedException errors when opening files, you may want to install a codec pack. The CCCP pack seems to work for most people.

Responses

  1. Dan says:

    March 19th, 2009 at 3:40 am (#)

    Interesting.

    So that’s a .flv file. Ever had any luck with .swf?

  2. Patrick says:

    March 20th, 2009 at 2:53 am (#)

    Hi Dan,

    I’ve tried a few swf files but haven’t had any luck yet. I’m getting MediaUnsupportedExceptions.

    Hopefully support for this will be added at some point, or maybe I’m doing something wrong. If you get this to work, let me know.

    — Patrick

  3. Tony says:

    May 1st, 2009 at 7:54 pm (#)

    Interesting article. I’m maintaining a RCP application for which I’ve just been asked to look into adding video capability. All I need is rudimentary playback capability, almost exactly how you describe your example plug-in actually.

    One thing that gives me pause is that I’m currently on Eclipse 3.2 under Java 5.0. I know that JavaFX requires Java 6.0 update 7 at a minimum. I certainly plan on upgrading both my Eclipse and Java versions eventually, but it’s not something I can do without a lot of regression testing, and I’m currently a one man show with a limited budget.

    Anyway, I was wondering whether you have any information as to whether the JMC portion of JavaFX actually requires Java 6, or can it be run under Java 5? Thanks.

    Tony

  4. Patrick says:

    May 5th, 2009 at 2:39 am (#)

    Hi Tony,

    I tried running the sample under Java 5 and, as you suspected, it didn’t work. Another solution might be to use the SWT browser control combined with video plugins. I haven’t tried this myself, but it might work.

    — Patrick

  5. Craig says:

    January 21st, 2010 at 2:10 am (#)

    I’ve been trying to get Flash screen capture animations to work within the VIPA RCP Help without much luck (Eclipse 3.4). I’m unsure how to configure the standard Jetty web server that RCP usually uses to serve its help pages, and I have been unsuccessful swapping it out for a different server.

    Any advice would be fantastic because I think Eclipse RCP Application Help with screen-captured Flash animations (with voice-over) would be a very beneficial, impressive and helpful to user.

    Craig.

  6. Patrick says:

    January 22nd, 2010 at 4:25 pm (#)

    Hi Craig,

    I wish I could help you, but I don’t have any experience in this area. My RCP projects haven’t had much to do with Jetty yet, but I think that might change after e4.

    I agree that what you’re trying to do would be really helpful, and if you get it working I hope you’ll post the solution here. I’d definitely want to use this on future projects.

    Regards,

    — Patrick

Leave a Response