8

I need to play a video in my JFrame. I've looked around and I have installed the Java media framework and I've tried numerous ways, media panel doesn't seem to work and I don't understand Player. If someone could tell me an easy way to play a video inside a JFrame or even which methods to call that would be great.

( I also have the .avi file in the same directory as the .class and .java files )

David Weiser
  • 5,138
  • 4
  • 25
  • 35
Jess McIntosh
  • 83
  • 1
  • 3
  • 5

2 Answers2

10

JMF is basically dead.

I don't have first-hand experience with playing video with Swing, but here's a list of alternatives to JMF you might try. There are also a number of SO questions about this already:

Based on those, it looks like Xuggler is the solution.

Community
  • 1
  • 1
Matt Ball
  • 344,413
  • 96
  • 627
  • 693
  • 9
    Because **it is dead.** The [last version was released in 2003](http://en.wikipedia.org/wiki/Java_Media_Framework) - that's over 8 years ago at this point. What makes you think it's _not_ dead? – Matt Ball Jul 30 '11 at 13:48
  • @ Matt Ball [can you answer this SO post](http://stackoverflow.com/questions/6885226/set-of-questions-related-to-playing-sound-video-in-java) Actually **I** was looking forward to it after reading about `Xuggler` – Suhail Gupta Jul 30 '11 at 19:45
1

For the casual reader, Xuggler is now deprecated. Use Humble video instead: https://github.com/artclarke/humble-video.

On the other hand, you can have a look at the vlcj project. It permits you embedding a native VLC media player in a Java AWT Window or Swing JFrame.

UPDATE Feb 04 '16

  • The Humble Video project seems inactive. There's no new updates since Janury the 3rd 2015.

  • vlcj is still active. The last update was done on Feb 03 '16.

Stephan
  • 40,082
  • 60
  • 228
  • 319