Results 1 to 3 of 3
  1. #1
    Fortu is offline Member
    Join Date
    Dec 2010
    Posts
    57
    Rep Power
    0

    Default How to go about playing video in a Java Application

    I've looked around on Google, and I found that I can play video through the JavaFX API and the JMF API, but I have a few questions that I haven't been able to find answers to:

    Which API should I use to play back either a .wmv or .avi file that will be read into the program by some sort of InputStream, maybe FileInputStream..

    Is there a way to play a video with audio using the public API? The video would need to be played as a transition between levels in my game, so I'd really prefer a public API answer to this (if there is one) rather than use one of these APIs which may not work on other machines that only have the regular JRE.

    Is it possible to do inside a JFrame? (I'd certainly hope so, because the game is inside a JFrame, so it would make it easier for people playing if everything was contained inside one window)

    Thank you to anyone who is able to help me answer my questions.

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    6

    Default

    Which API should I use to play back either a .wmv or .avi file that will be read into the program by some sort of InputStream, maybe FileInputStream..
    Remember that .avi and .wmv are not codecs but rather containers. An AVI can contain anything from xvid, h.264, divx, uncompressed, etc... Same for WMV. You would need decoding support of these underlying codecs in order to play the files - I'm not sure JMF or JavaFX support the codecs.

    I suggest looking at the documented formats supported by the frameworks and converting your source video to one of those - Java's media support is kind of lack-luster, especially the cross platform versions.

  3. #3
    Fortu is offline Member
    Join Date
    Dec 2010
    Posts
    57
    Rep Power
    0

Similar Threads

  1. Replies: 0
    Last Post: 09-17-2010, 09:48 AM
  2. problem with playing video in javafx application
    By kiranblighty in forum JavaFX
    Replies: 1
    Last Post: 02-27-2010, 12:09 AM
  3. Video Conference application in J2ME
    By srikant_ in forum CLDC and MIDP
    Replies: 1
    Last Post: 03-10-2009, 06:22 AM
  4. Embed video on web page - Application to Applet
    By ConvoyTh in forum Java Applets
    Replies: 1
    Last Post: 11-27-2008, 07:05 AM
  5. Replies: 1
    Last Post: 10-05-2008, 11:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •