Playing Movies in JAVA

Hey all,
This is a quick question:
I want to play a movie in an app I am making, I was wondering what classes I should research that I would use to accomplish this goal. I've obviously not done this before,
Thanx,
Kngus

Java Media Framework... http://java.sun.com/products/java-media/jmf

Similar Messages

  • Play movie with java

    Hey,
    Im searching for a way to play a movie with java (without using JMF or javafx, these are media players only?),
    I want to play a movie in my app. how do i do this?

    I don't know, but JMF is not as inflexible as you imagine it to be. Why not ask in the forum dedicated to JMF?
    [http://forums.sun.com/forum.jspa?forumID=28]

  • How to play movie file using java tv

    hi,
    i am trying to play movie file(.mov or mpg or mp3) using java tv in linux plotform and also using jmf jar.
    problem is while running appear black screen and getting exception or errors like
    Unable to handle format: ima4, 480x320, FrameRate=25.0, Length=460800 0 extra bytes
    Thank in adv

    Well...
    I don't know how to load and play a video with JavaTV. But I've seen some posts telling that .mpg files aren't accepted by the JavaTV.
    Some people said that I had to use .avi files and these .avi files, if they were converted from a .mpg file, must had been converted with the Cinepack technology, but I don't know how to do this.
    If you find out how to load and play a video, I'd like to know, please send me an email or access my page and post there in the comments, so I can continue doing my application with a video.
    []'s
    Cauane B.S.
    Computer Science
    CNPq Researcher - TVDi
    http://cauanebs.blogspot.com
    UCPel - Pelotas - RS

  • Cannot play .mov Files....

    I am not able to play .mov files in my JFrame Window....
    The Visual Content shows onli a pink screen and following exception...
    The mov file which i tried to play is a standard file and plays well with quicktime player... Its not working with my code alone... I ve posted my code also... Can anyone look at this issue and guide me????
    *--------------------Configuration: <Default>--------------------*
    *# An unexpected error has been detected by Java Runtime Environment:*
    *#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c911c48, pid=1864, tid=996*
    *# Java VM: Java HotSpot(TM) Client VM (11.2-b01 mixed mode, sharing windows-x86)*
    *# Problematic frame:*
    *# C  [ntdll.dll+0x11c48]*
    *# An error report file with more information is saved as:*
    *# D:\project\New Folder\hs_err_pid1864.log*
    *# If you would like to submit a bug report, please visit:*
    *#   http://java.sun.com/webapps/bugreport/crash.jsp*
    *# The crash happened outside the Java Virtual Machine in native code.*
    *# See problematic frame for where to report the bug.*
    *import javax.media.*;*
    *import java.awt.BorderLayout;*
    *import java.awt.Component;*
    *import javax.swing.*;*
    *public class summar extends javax.swing.JFrame {*
        *public summar() {*
            *initComponents();*
        *private void initComponents() {*
            *trailer1 = new javax.swing.JPanel();*
    *          trailer1.setLayout(new BoxLayout(trailer1,BoxLayout.Y_AXIS));*
    *          trailer1.setVisible(true);*
            *setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);*
            *getContentPane().setLayout(null);*
            *trailer1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));*
    *Player player=null;*
                    *try{player=Manager.createRealizedPlayer(new MediaLocator("file:\\c:\\common\\trailer.mov"));*
                    *player.setMediaTime(new Time(30.0));*
                    *trailer1.add(player.getVisualComponent());*
    *          Control controls[]=player.getControls();*
    *          CachingControl cc=null;*
                    *for(int i=0;i<controls.length;i++)*
    *               if(controls[i] instanceof CachingControl)*
    *                    cc=(CachingControl) controls;*
    *                    trailer1.add(cc.getProgressBarComponent());     *
    *                    System.out.println("Found CachingControl");*
    *          if(player.getControlPanelComponent()==null)*
    *               System.out.println("Null");*
    *          else*
    *               trailer1.add(player.getControlPanelComponent());*
    catch(Exception e1){}
    getContentPane().add(trailer1);
    trailer1.setBounds(250, 70, 320, 220);
    pack();
    *public static void main(String args[]) {*
    summar s=new summar();
    s.setBounds(0,0,960,660);
    s.setVisible(true);
    private javax.swing.JPanel trailer1;

    When I 1st used QT after upgrading to ML, I received a message saying that a codec was missing, and that accordingly QT  could not play the files.  Just now, after tinkering with VSL in vain, I re-launched QT, and opened what had been a '.mov'-file, only to find that it is now an '.mpg'-file.  How that transformation occurred, I do not know, but the result is that QTwill play the file perfectly well.
    I am back with QT, and many thanks to you all that have tried to help.

  • HOW to play flash inside java application program

    Do java provide any API for playing flash inside java application ?Pleae give me some help about it .Thank You ..

    pingyi wrote:
    Do java provide any API for playing flash inside java application ?Pleae give me some help about it .Thank You ..bro... I found out there from the internet... but you need to purchase it.
    hope it meets your expectation...
    JFlashPlayer is a Flash Player API Java package that lets developers play and interact with Adobe? Flash Player movies within Java applications. Advanced animations can improve the user experience and add to the professional appearance of an application. JFlashPlayer allows programmers to quickly add Flash movies to their Java application development for Windows.taken from: JflashPlayer

  • Question - applet using JMF for playing .mov

    I develop an applet using JMF for playing .mov. It works fine, and the applet starts normally. Even my applet works fine from other computers in our LAN (The applet runs ok without JMF). But only on one PC it doesn't work and I get the following message
    Failed to configure: com.sun.media.PlaybackEngine@a7c45e
    Bad header in the media: moov atom not present
    Error: Unable to realize com.sun.media.PlaybackEngine@a7c45e
    FATAL ERROR: Failed to realize: failed to parse the input media.
    Exception in thread "JMF thread: SendEventQueue: com.sun.media.content.unknown.Handler" java.lang.Error: Failed to realize: failed to parse the input media.
    at PlayerApplet.Fatal(PlayerApplet.java:201)
    at PlayerApplet.controllerUpdate(PlayerApplet.java:191)
    at com.sun.media.BasicController.dispatchEvent(BasicController.java:1254)
    at com.sun.media.SendEventQueue.processEvent(BasicController.java:1286)
    at com.sun.media.util.ThreadedEventQueue.dispatchEvents(ThreadedEventQueue.java:65)
    at com.sun.media.util.ThreadedEventQueue.run(ThreadedEventQueue.java:92)
    My html:
    <html>
    <head><title>PlayerApplet</title></head>
    <body>
    <applet code="PlayerApplet.class" archive="fobs4jmf.jar, customizer.jar, jmf.jar, mp3plugin.jar, sound.jar, multiplayer.jar, mediaplayer.jar" width=640 height=510>
    <param name=file value="safexmas.mov">
    </applet>
    </body>
    </html>
    Anyone can help me?
    Thanks for your time

    It started to work but I had to install fobs4jmf on the client computer.
    And put .dll to windows/system33 directory. But how can I play video using applet in browser without installing any software on the client machine?

  • Play movie with JMF

    Hey,
    I just started out with JMF (I wanted to play a movie with java).
    I got this code:
    import java.applet.*;
    import java.awt.*;
    import javax.swing.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import javax.media.*;
    * Demonstrate simple code to play a movie with Java Media Framework.
    * @author Ian F. Darwin, http://www.darwinsys.com/
    * @version $Id: JMFPlayer.java,v 1.9 2004/02/09 03:21:20 ian Exp $
    public class NewJApplet extends JPanel implements ControllerListener {
        /** The player object */
        Player thePlayer = null;
        /** The parent Frame we are in. */
        JFrame parentFrame = null;
        /** Our contentpane */
        Container cp;
        /** The visual component (if any) */
        Component visualComponent = null;
        /** The default control component (if any) */
        Component controlComponent = null;
        /** The name of this instance's media file. */
        String mediaName;
        /** The URL representing this media file. */
        URL theURL;
        /** Construct the player object and the GUI. */
        public NewJApplet(JFrame pf, String media) {
            parentFrame = pf;
            mediaName = media;
            // cp = getContentPane();
            cp = this;
            cp.setLayout(new BorderLayout());
            try {
                theURL = new URL(getClass().getResource("."), mediaName);
                thePlayer = Manager.createPlayer(theURL);
                thePlayer.addControllerListener(this);
            } catch (MalformedURLException e) {
                System.err.println("JMF URL creation error: " + e);
            } catch (Exception e) {
                System.err.println("JMF Player creation error: " + e);
                return;
            System.out.println("theURL = " + theURL);
            // Start the player: this will notify our ControllerListener.
            thePlayer.start(); // start playing
        /** Called to stop the audio, as from a Stop button or menuitem */
        public void stop() {
            if (thePlayer == null) {
                return;
            thePlayer.stop(); // stop playing!
            thePlayer.deallocate(); // free system resources
        /** Called when we are really finished (as from an Exit button). */
        public void destroy() {
            if (thePlayer == null) {
                return;
            thePlayer.close();
        /** Called by JMF when the Player has something to tell us about. */
        public synchronized void controllerUpdate(ControllerEvent event) {
            // System.out.println("controllerUpdate(" + event + ")");
            if (event instanceof RealizeCompleteEvent) {
                if ((visualComponent = thePlayer.getVisualComponent()) != null) {
                    cp.add(BorderLayout.CENTER, visualComponent);
                if ((controlComponent = thePlayer.getControlPanelComponent()) != null) {
                    cp.add(BorderLayout.SOUTH, controlComponent);
                // re-size the main window
                if (parentFrame != null) {
                    parentFrame.pack();
                    parentFrame.setTitle(mediaName);
        public static void main(String[] argv) {
            JFrame f = new JFrame("JMF Player Demo");
            Container frameCP = f.getContentPane();
            NewJApplet p = new NewJApplet(f,
                    argv.length == 0 ? "file:/C:/Users/Patrick Kos/Pictures/BAA.avi"
                    : argv[0]);
            frameCP.add(BorderLayout.CENTER, p);
            f.setSize(200, 200);
            f.setVisible(true);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }but I always get a unable to handle format exception, expect with mp3 files.
    But i"ve looked up the supported formats and its says its supported so??

    i get this error
    Unable to handle format: XVID, 320x240, FrameRate=29.9, Length=230400 0 extra bytes
      Unable to handle format: unknown, 22050.0 Hz, 0-bit, Stereo, Unsigned, 8000.0 frame rate, FrameSize=9216 bits
    Failed to realize: com.sun.media.PlaybackEngine@7259da
    Error: Unable to realize com.sun.media.PlaybackEngine@7259da
    Exception in thread "main" javax.media.CannotRealizeException
            at javax.media.Manager.blockingCall(Manager.java:2005)
            at javax.media.Manager.createRealizedPlayer(Manager.java:580)
            at projectnemo.NewJApplet.main(NewJApplet.java:102)

  • Play movie with subtitle..

    i am using JMF player to play movies
    i have downloaded some codecs (jffmpeg)
    but one thing is missing
    displaying subtitles
    i been searching google but find nothing
    There is something written all ready
    or
    should i start thinking how to do it my self.
    i am thinking about using a glass pane to draw the subtitles
    but i need and a subtitle parser (SRT,SUB files)
    there is something written in java ?
    or i need to do it by my self.
    if all made by me?
    i have question about subtitle timing
    can i use JMF to throw some event when a
    certain time in the movie is arrived
    i don't want to check every second?
    allot of questions
    any help will be appreciated
    thanks allot
    shay

    It's so xxxx complicated to play a movie with subtitels
    since JMF was last updated at 2004.
    i am giving a try to MPlayer.
    may be when there is a new version of JMF
    with no need of hacking things like:
    searching for codecs all over the web
    find one site that hack JMF to display text over JMF Player .(and i searched google)
    find a responsible why to handle player timing (subtitle timing)
    and more simple why to play a movie without catching alot of exceptions
    till you lost your mind.
    sorry .i rely give it a try.
    thanks allot every one.

  • Subtitles are not getting displayed while playing movies

    Hi,
    Recently I have upgraded with Max OS X 10.6 Snow Leopard. After this upgrade whenever I play movies in my VLC player, I am getting a message as "freetype: failed to load font file /System/Library/Fonts/LucidaGrande.dfont" and then the subtitles are not displayed.
    Can someone advise how to resolve it? I tried to download LucidaGrande.dfont from internet. But I couldnt find one. Please help.
    Thanks.
    Ravi

    Hello, Ravi & welcome to the forums.
    Lucida Grande is included with Mac OS X.
    Check and validate all of your fonts with Apple's Font Book (look in the Applications folder). Search for Lucida Grande to be sure it was properly installed. Find and remove duplicates as well.
    Also, don't hesisate to perform wholesale deletion of old and/or little used fonts - be skeptical of anything that has come from Office 2008, including those related to an Equation Editor installation.
    Finally, be sure all the apps you are using are compatible with SnowLeopard. Check with their authors for updates.

  • Unable to play some movie from Netflix on my iPad. When I click on a movie an error message comes up which says "cannot play movie. Please try again". Can anyone assist me? I just upgraded to iOS 7.1. Netflix not able to find problem.

    Unable to play some movies from Netflix on my iPad. When I click on a movie an error message comes up "Cannot play movie. Please try again later." I contacted Netflix but have not been able the help so I am wondering if it's my iPad. I didn't have a problem before but I have recently upgraded to iOS 7.1. Also is a certain amount of storage needed to play a movie? About how much is that?

    Hello all,
    I have an iPad 2 16GB with iOS 7.0.3 and Netflix version 5.0.2. I cannot watch netflix on an External LCD monitor that I have through VGA out. I use bluetooth speakers, so the AirPlay is going to that for Audio. Before this update, this combo worked without an issue.
    So as of Friday Nov. 8/2013, I contacted Netflix support, and they said they fixed the problem on their end, and the fix is on the Apple side of things, and to contact Apple support.
    So, I contacted Apple support, and the first person I spoke to said I would have to agree to pay a $35 fee for 30 days of support to this problem since my unit is out of warranty. I said this isn't a hardware issue, it's a software issue, and I'm not willing to pay to fix a problem you created. So I got a Senior Level advisor on the line, and she was helpful, and she's looking into the issue for me and said she'll contact me sometime on Tuesday or Wednesday (Nov. 12 or 13) to let me know of the issue.
    Here's the thing: this is a combination of Netflix and iOS not working correctly with any of the Apple Authorized Dongles. This is truly a code error that some hot shot programmer had major oversight on, and their management didn't catch it either. There was no reason for Netflix to rush to get this Netflix update going until Apple sorted out the bugs in iOS 7.
    Anyway, if I hear anything from Donna (the advisor), I'll post it and let you guys know. In the mean time, good luck!

  • Randomly Apple TV can't play Movies/Tv shows and music.

    I've seen other people having problems with this issue but with all my searching, have not found an answer and thought I'd share my experience in case someone has a solution or suggestion.
    Our cable modem service comes into an access pannel in the bedroom closet. It goes to the Linksys WRT54G router, then to a hub which sends out to all the rooms in our house. Our house is new and pre-wired for ethernet in each room. It comes in the office, goes into another hub and then to the Mac Mini I have and to a NAS Lacie storage drive where all my movies, music and photos are at. We stream everything and only synk photos on the Apple TV.
    Over the last couple of days, the Apple TV can't play movies or music for some reason. The errors I get with Movies/TV is "The selected video cannot be played." The format was not recognized. With music the message is "Apple TV cannot play the current song." I know all the movies and music work because a day before I just played I AM LEGEND and it worked perfectly.
    I've got a couple of theories and wanted to float them by everyone. I use a Harmony 880 remote and when I select Apple TV, it turns on the ATV and then sets the inputs on the other items. When I'm done and select watch TV, it turns ATV off. Should the ATV stay on all the time? Could this be causing the problem?
    I've restarted the ATV, the Mac Mini, the hubs, the cable modem, the router. Nothing brings it back. But if it sits for a while, a couple hours or so, then it's back. However, it just stops playing for no reason and the next day it might not work again.
    I'm running iTunes 7.6.2 and I checked the ATV and iTunes and both say they are up to date on their software.
    I could really use some help here. The frustrating part is the kids want to watch one of their movies for the 700th time and it won't play many time.
    Thanks everyone.
    John
    I use a Harmony 880 (I believe) remote.

    Oops----thinking of the light on the Airport!!! =-)
    The status light is gray, so it is not setting off any "alarms", everything else is working, but when I go to watch a movie, rented or owned, it times out and resets itself. I ran a diagnostic and it said everything was working properly, I reset to factory settings and still had the same problem, and even reset the Airport to make sure it was not just the connection.
    At a complete loss as to any other ideas to try to get her up and running again. No way am I going anywhere near an Apple Store with all the iPad hype that is out right now!!!!!!

  • Can I move only my iTunes movies, not my iTunes music, onto a flash drive? And, is there a program (apart from iTunes) that can play movies on MacBook Air?

    I have a MacBook Air and I need to free up space...
    1) I have three series of a tv show on my itunes which are taking up loads of memory - see image - I want to move these movie files onto a Flash Drive. However I do not want to move my itunes Music onto the flash drive, only my Movies, and want to keep my music on my hard drive.
    Is this possible?
    2) I have managed to copy the movie files onto the flash drive, however when I tried to play one to check that they were loaded properly it didn't have a program that could run the file (they have copied over in a m4V format). Do the MacBook Air's not have a separate program other than itunes that can play movies? If so, is there a program I can get to solve this problem? I went onto the App Store to see if there was something I could download, but all the apps were for creating DVD's, not simply playing them.
    3) If 1. & 2. questions are solvable, will it then be safe to delete the movies from my itunes?
    Thank you so much for any answers posted.
    Best,
    Eloise15.

    1) However I do not want to move my itunes Music onto the flash drive, only my Movies, and want to keep my music on my hard drive.
    Is this possible?
    Yes
    2) Do the MacBook Air's not have a separate program other than itunes that can play movies? If so, is there a program I can get to solve this problem? I went onto the App Store to see if there was something I could download, but all the apps were for creating DVD's, not simply playing them.
    If you can play the movies in iTunes, you should be able to open the movie files using Quicktime, which should already be on your system.  If you have already transferred the files to your flash drive, open the flash drive in Finder, and hold control when you click on the movie file (or right click if you have the enabled) and select Open With Quicktime Player.  This should play the movie directly from the flash drive. 
    If you want to set all .m4v files to open with Quicktime by just double clicking on the file, you can follow the steps here: http://www.tech-recipes.com/rx/2573/os_x_how_to_change_default_application_to_op en_file_type/
    3) If 1. & 2. questions are solvable, will it then be safe to delete the movies from my itunes?
    You can move the TV shows to your flash drive by dragging them from the iTunes window to your flash drive in Finder or the flash drive icon on the desktop.  When you are sure everything is transferred over to your external device, you can delete the movie from iTunes.  I recommend playing the videos from the flash drive first before deleting them in iTunes. 
    To delete the videos from iTunes, you can highlight them and press the delete key on your keyboard.  In the next prompt, you would want to move it to the trash so that it is deleted from your internal hard drive.  
    I hope that helps!

  • When I connect my iPhone 5 to my laptop and iTunes, I can't play movies from the iPhone on my computer.Why is that? Can I do this or it's not possible with iPhone5? With my iPod it's no problem.

    When I connect my iPhone 5 to my laptop and iTunes, I can't play movies from the iPhone on my computer.Why is that? Can I do this or it's not possible with iPhone5? With my iPod it's no problem.

    Reinstall iTunes. Make sure you follow the instructions in this support document to the letter. http://support.apple.com/kb/HT1923.
    You may have some problems because Apple has not certified that everything works with Windows 8 yet.

  • How do I play movies on time capsule via apple tv?

    i'd like to play movies saved on time capsule (plus external disks connected to time capsule) on apple tv.
    can I do it bypassing my mac or the only way is to read it using itunes?
    thanks

    Welcome to the Apple Community.
    All content must be played through iTunes.

  • HT204382 what software do i need to play movies on avi file . have connected a external memory disk and all the movies are in avi format.

    What software do i need to install in order to be able
    to play movies in .avi format.
    have connected an external memory and all the entertainment
    files are in .avi format.
    Ansver i get : does not support

    VLC is a good choice. While I don't know if it will play your files, Perian is a helper app for Quicktime which allows you to play a lot of things in the Quicktime Player.
    There is also Flip4Mac which allows you to play windows media files in Quicktime.
    Finally, note that the extension on a video file doesn't really tell you what you need to play it. The .avi, .mpg, etc. is only the wrapper around the actual video. The video is encoded by some means and needs to be decoded. The video inside the .avi can be encoded in one of many different schemes.
    VLC, Perian, Flip4Mac, and many others, are all able to decode various flavors of encoding. Having all of those in your toolbox will help to allow you to play most of the things you'll find.

Maybe you are looking for

  • Is this a new problem for the zen mic

    I havent found anything about this on the forum but I have to agree that I didnt search a lot , but since a couple of days, I got a new problem on my micro, it started skipping part into some songs then would go back and then skip some parts, it's ve

  • Personal Domain not function after Move the Domain (iWeb) to a New Mac

    Hey, I recently move my iWeb Domain to a new Macbook Pro..after Published the iWeb...the message window shown visit the website as web.me.com/xxx instead www.xxx.com Why? i try to reset the personal domain in MobileMe ,remove it and add it again...no

  • Mini or iMac

    I would like to buy a new Mac but not sure if I should go with the Mac mini or iMac. I will use it to edit home videos and surf the web. I was going to either get a 1.66GHz Mac mini with 1GB ram and hook it up to my HDTV or the 17" iMac with 1GB ram.

  • Control-Hints are suppose work with UIX/XML, right?

    Control-Hints are suppose work with UIX/XML, right? I've added some control hints and they worked correctly when viewed using UIX/JSP pages. However, none of the Control-Hints appear on UIX/XML pages. The documentation suggests that this should work.

  • I can't install apps from my apple store, need help

    Hi All, I have an iphone 3GS. I used to download free as well as purchased apps from the app store. For some reason I am not able to do that anymore. For example when I try to open my facebook app, it keeps on not opening it, last time it did that to