I am building a small Swing application that I would like to embed a movie within. Importantly, this application is a WebStart application - and the library should be able to be packaged within the jnlp that I launch -i.e, not dependent on native libraries.
I am aware of and have tried JMF but the format compatibility I believe to be relatively poor when compared to other frameworks out there.
Could someone please provide a sample code snippet of a simple implementation using their recommended library?
Many thanks in advance.
You are right about the lack of support for modern codecs, but it works just fine for older codecs. It might be a viable option if:
While the 'performance pack' version of the JMF which uses natives supports more formats, the core Java JMF API also provides some basic formats.
Some considerations for JavaFX as a solution as a Java based media playback framework.
Here is a sample JavaFX app which plays a video:
Although I have not had any problems with formats compatibility o JMF you can take a look in JavaFX that was designed to be a competitor to Flash, so should support all media formats and codecs. You can also embed Flash player into java application using JNI/JNA but it seems too complicated. I'd recommend you to start with JMF and look for other solution only if you really have problems.