Video and Eclipse
Join the DZone community and get the full member experience.Join For Free
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.
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.
Opinions expressed by DZone contributors are their own.