JMF player and a selected file/mpg

Does anyone know how to change this piece of code so a JMF player can run when a file/mpg is selected.
final File directory = new File(".");
    File[] files = directory.listFiles();
    for(int x = 0; x < files.length; x++)
      if(files[x].isFile()) dim.addElement(files[x].getName());
     btn2.addActionListener(new ActionListener()
           public void actionPerformed(ActionEvent ae)
             int selectedIndex = list.getSelectedIndex();
             if(selectedIndex < 0)
               JOptionPane.showMessageDialog(null,"Please select file");
             else
               File fileToDelete = new File((String)list.getSelectedValue());
               if(fileToDelete.delete()) dim.removeElementAt(selectedIndex);
               }}});

I don't understand?
On the program that I use it's works.
When I put a button, the video close, and the I open an another by launching this method:
public void openFile(String filename)
     String mediaFile = filename;
     // URL for our media file
     URL url = null;
if(player!=null)
player.stop();
player.deallocate();
desktop.removeAll();
repaint();
try
     // Create an url from the file name and the url to the
     // document containing this applet.
     if ((url = new URL(mediaFile)) == null)
          Fatal("Can't build URL for " + mediaFile);
          return;
     // Create an instance of a player for this media
     try
          player = Manager.createRealizedPlayer(url);
catch (NoPlayerException e)
          Fatal("Error: " + e);
catch (CannotRealizeException e)
catch (MalformedURLException e)
     Fatal("Error:" + e);
catch (IOException e)
     Fatal("Error:" + e);
     if (player != null)
     this.filename = filename;
     jmframe = new JMFrame2(player, filename);
//jmframe.setSize(200,100);
     desktop.add(jmframe);
I hope that It could Help you.
You can find an exemple quite similar on this site , the name of the file is: MDIApp.java
;)

Similar Messages

  • I recorded audio with Quicktime player and the sound files won't disappear from the desktop no matter how I try to put them in the trash...

    I recorded audio with Quicktime player and the sound files won't disappear from the desktop no matter how I try to put them in the trash...tried xing out the red x, putting them in the trash...right clicking to make them disappear...nothing works...

    Just got rid of them... I closed Quicktime and was asked to delete. So I deleted them. Problem solved.

  • Make Record for folder and multi-selected files

    Hi,
    'Make Record' item disappeared in MENU for folders not for files.
    And it can't make record for multi-selected files.
    I can only make Record by one and one.
    How to make Records for folder and multi-selected files?
    Regards
    Kitae

    Programatically, only a single document at a time can be made a record :-
    makeRecord
    public Item makeRecord(long parentId,
    long docId,
    NamedValue[] attrs,
    AttributeRequest[] attributes)
    throws FdkException
    You could potentially through a custom workflow triggered on UserRequest allow multiple submitted documents to be made records through a custom BPEL process calling Content DB Web Services.
    Matt.

  • File browsing and showing selected files in a datagrid? i'm missing something small... i hope

    I am currently allowing the user to browse and select multiple files. I'd like to display the selected files in a datagrid. Here's my code. What am I missing?
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                                         xmlns:s="library://ns.adobe.com/flex/spark"
                                                         xmlns:mx="library://ns.adobe.com/flex/mx">
      <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
      </fx:Declarations>
      <fx:Script>
                        <![CDATA[
                                  import mx.collections.ArrayCollection;
                                  public var Files:File;
                                  [Bindable]
                                  public var arrUploadFiles:Array;
                                  private function init():void
                                            arrUploadFiles = new Array()
                                            Files = new File(); 
                                            Files.addEventListener(FileListEvent.SELECT_MULTIPLE,onSelect_multiple_files); 
                                            Files.browseForOpenMultiple("Select Files to Send!!"); 
                                  public function onSelect_multiple_files(f_evt:FileListEvent):void
                                            for each(var tempF:File  in f_evt.files){ 
                                                      tempF.load(); 
                                                      arrUploadFiles.push(tempF);
                                                      trace (tempF.nativePath);
                        ]]>
      </fx:Script>
              <s:Button x="259" y="454" label="Browse for Files" click="init()"/>
              <s:DataGrid x="159" y="211" requestedRowCount="4">
      <s:columns>
      <s:ArrayList>
                                            <s:GridColumn dataField="dataField1" headerText="Column 1"></s:GridColumn>
                                            <s:GridColumn dataField="dataField2" headerText="Column 2"></s:GridColumn>
                                            <s:GridColumn dataField="dataField3" headerText="Column 3"></s:GridColumn>
      </s:ArrayList>
      </s:columns>
      <s:typicalItem>
                                  <fx:Object dataField1="Sample Data" dataField2="Sample Data" dataField3="Sample Data"></fx:Object>
      </s:typicalItem>
      <s:ArrayList>
                                  <fx:Object dataField1="data1" dataField2="data1" dataField3="data1"></fx:Object>
                                  <fx:Object dataField1="data2" dataField2="data2" dataField3="data2"></fx:Object>
                                  <fx:Object dataField1="data3" dataField2="data3" dataField3="data3"></fx:Object>
                                  <fx:Object dataField1="data4" dataField2="data4" dataField3="data4"></fx:Object>
      </s:ArrayList>
      </s:DataGrid>
    </s:WindowedApplication>

    Arrays do not send out change events so the DG doesn’t know you pushed things onto it.  If you used the DG’s dataProvider it will have wrapped the array in an ArrayCollection and will notice the changes.  There is a FileSystemDataGrid component by the way.

  • "Media offline" and "The selected file cannot be linked"

    Ok, I'm extremely frustrated right now.  I opened up a project file, and all of my motion backgrounds say "Media offline."  The files have not been moved or changed.  They haven't even been touched.  So, I tried to link them back, but then it says "The selected file cannot be linked because its type (video) does not match the original file's type (audio and video)." 
    There was never any audio associated with these files.  These files have always been just motion backgrounds.
    I can't just reimport them and start over.  There are too many of them.
    Is there any way I can just override the error?  I obviously don't need any audio.  I don't understand why there's no option to just link without the audio, especially since there never was any audio.

    Sorry, this is CS3.  I forgot to write that.
    Edit: Ok, if anybody else has this problem and finds this through Google, I found out what caused it and how to fix it.
    Some other program, I think a video converter, rewrote my codecs.  And it didn't do a good job.  I had already removed the video converter because it wasn't any good anyway.  So, I went through my "Uninstall or change a program list" (this being Windows), and removed everything that didn't look familiar, and then I reinstalled Xvid.  Now it works fine.

  • Adobe flash player and reading pdf files.

         I've recently been having issues with Safari reading online pdf files and loading up sites using adobe flash player.
         I've somehow tracked down a temporary solve by going into Safari's "preferences", then the security tab.
         Where it shows "internet plug-ins" I have it checked so it can load adobe flash. But when it comes to reading pdf files (adobe reader)
         I have to uncheck "internet plug ins". So in turn I can read the pdfs, but not use adobe flash player.
         There seems to be a conflict between the adobe reader and flash player that I can use both at the same time.
         Any suggestions on how to correct this issue?
         Here's a screenshot of what I have. And if I have to delete one of these plug-ins how can I do this as I don't see any options to do so.

    Back up all data before making any changes. Please take each of the following steps until the problem is resolved.
    Step 1
    If Adobe Reader or Acrobat is installed, and the problem is just that you can't print PDF's displayed in Safari, you may be able to print by moving the cursor to the the bottom edge of the page, somewhere near the middle. A black toolbar may appear under the cursor. Click the printer icon.
    Step 2
    There should be a setting in its preferences of the Adobe application such as Display PDF in Browser. I don't use those applications myself, so I can't be more precise. Deselect that setting, if it's selected.
    Step 3
    If you get a message such as ""Adobe Reader blocked for this website," then from the Safari menu bar, select
    Safari ▹ Preferences... ▹ Security
    and check the box marked
    Allow Plug-ins
    Then click
    Manage Website Settings...
    and make any required changes to the security settings for the Adobe PDF plugin.
    Step 4
    Triple-click anywhere in the line of text below on this page to select it, the copy the selected text to the Clipboard by pressing the key combination command-C:
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, move to the Trash any items that have "Adobe" or “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari.
    Step 5
    The "Silverlight" web plugin distributed by Microsoft can interfere with PDF display in Safari, so you may need to remove it, if it's present. The same goes for a plugin called "iGetter," and perhaps others — I don't have a complete list. Don't remove Silverlight if you use the "Netflix" video-streaming service.
    Step 6
    Do as in Step 4 with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari.

  • Flash Player and Captivate 5 files

    So the newest version of FLASH makes the output from the newest version of Captivate broken.
    http://kb2.adobe.com/cps/879/cpsid_87992.html
    My question is, will the NEXT FLASH update fix the problem?  My organization has dozens of elearning courses built in Captivate 5 that would require a lengthy republishing process to get them back into our LMS, I am hoping instead the Adobe fixes its own mistake with the next version of Flash so we can just have our users avoid the version of Flash that caused the problem to begin with.
    Any help/answers would be most appreciated!
    Thank you,
    Matthew

    You can easily find out by downloading the beta version of Flash Player 10.2.

  • When in Bridge CS6 and I select File / Open in Camera Raw...  I get a dialog box that says:  Camera

    Camera Raw editing requires that a qualifying product has been launched at least once to enable this feature.

    Hi! This is not a paid support chat, please allow some time for other users to help you.
    Bridge or Camera Raw are programs that comes bundled with other software. To activate them, you usually need to run Photoshop, for instance.
    Message was edited by: TerriStoneCHL

  • How should I create JAR file which  contain JMF library and project classes

    Hi,
    I installed the JMF windows pack. I compiled and ran successfully myApplet (which use JMF librarie) in Internet Explorer on my machine. When I run this applet on some different machine, where JMF isn�t installed- it�s not running.
    There is an error:
    java.lang.NoClassDefFoundError: javax/media/ControllerListener
    I was trying to create jar file, which contain librarie JMF.jar and all other files which are require to run myApplet (*.jar, *.class, the files from folder �MyApplet�) and run it on the other computer. It still doesn�t work.
    Also I ran a JMF Customizer and created customize.jar but this file contains only JMF classes. I don�t know how add other files to it.
    How should I create a jar file which will contains all essential files to run myApplet on other machine (something like �All In One� J )
    I�m using Eclipse.
    Can somebody help me?.
    Thank You!
    Best regards:
    Peter

    Hi
    i want to make a jar file of application which is using JMF to play audio
    and video. it works well during compilation and execution but doesn't
    works in jar file.
    please help me how i make a jar file whic will run audio and video too
    your's truely
    abdul

  • Finding Selected Files

    I started a thread asking how I can find and delete selected files at http://discussions.apple.com/thread.jspa?messageID=6435289#6435289
    I was advised to paste the following script into Apple's Script Editor...
    tell application "Finder"
    delete (every file of entire contents of folder "Sites" of home whose name is "Thumbs.db")
    end tell
    Unfortunately, it doesn't work. It just times out, my Finder freezes, and I have to manually restart my computer.
    However, it does at least FIND every instance of the file I'm looking for. So I'd like to ask about a few variations of this script so I can understand how it works.
    Suppose that instead of searching for every instance of Thumbs.db in the folder Sites I wanted to search for every instance of Thumbs.db in User/Sites/MySite. What script would I write to do that? What about searching for the file in User/Sites/MySite/includes ?
    Also, what about searching for text on a page rather than a file name? For example, I would like to compile a list of every file in a website that includes a PHP database query. I think I could find all of these queries by searching for mysql_ in each web page's source code. So how could I search for every file that includes "mysql_" in User/Sites/MySite?
    Thanks.

    1. Use:
    tell application "Finder"
    delete (every file of entire contents of folder "Sites:MySite" of home whose name is "Thumbs.db")
    end tell
    2. This is best done with a tool such as TextWrangler instead of with AppleScript.
    (28479)

  • Is it possible to embed a media player and media in a ADE ePub

    Playing around with ePub ebooks particularly embedding audio/video in ePubs.
    I've seen a number of examples that show embedding/playing a swf file in an epub and it plays ok in ADE.
    However, I'd like to be able to embed a media player e.g. StrobeMediaPlayback.swf or JW Player and a media file and have the player play back the embedded media file.
    When I try this the player shows up but it will not play the file.
    I've included references to the swf and media files in the ePub manifest.
    Here is an example object tag.  This works fine if I load the html page in a browser like FireFox.
    <object width="470" height="320" type="application/x-shockwave-flash" data="player.swf">
    <param name="movie" value="player.swf"></param>
    <param name="flashvars" value="file=video.flv"></param>
    </object>

    No, it is not. Worse, many people will view this in any old PDF viewer, most of which won't have overprint preview at all.
    You need to send very clear instructions about this, with specific screen shots - or better, avoid tools and constructions that require it. Probably some wording about "need to view with suitable professional tools" will make the message more palatable.

  • Zip files and Adobe Acrobat files

    Hello all,
    I have a couple of kinda distinct questions that I wanted to ask. I hope I've chosen the right sub-forum to post them in. My questions are
    1) when I try to unzip a .zip file in my Documents folder I get the following error message
    "Archive Utility - unable to unarchive "CdnEnergy.zip" into "Documents". (Error 1 - Operation not permitted.)"
    ditto if I move it to the Desktop and try there. This doesn't seem to be a 'space' problem as my computer is very new and I haven't loaded it up with lots of stuff. I have unzipped this file before (admittedly not on a Mac).
    2) How can I set Adobe Acrobat to be the default application for .pdf files so that when I click on a pdf file it's opened by Adobe Reader rather than the Mac Viewer? I know I can select Adobe with a Ctrl+click, but can I set it so that it's always the default?
    Thanks very much for your help,
    Eoghan

    Welcome to the Discussions!
    The first problem is not obvious, but I would suggest using Disk Utility to repair permissions. Also, you could download the free Stuffit Expander to have an alternate unzip program.
    The second problem is easy. In the Finder, select a pdf file and then select File->Get Info. In the window that appears, select the Acrobat as the Open With application and select the option to always use this application.
    bd

  • Playing a ts-file in an application  (JMF,without Tuning/service selection)

    Hey there!
    I got a ts-File (1.438.1) on HDD and i am trying to play it using a jmf-player in my application. I know that MHP does not support playing video from HDD but the IRT RI (which i use) does..
    For a ts is also just a *.mpg-file i thought my solution would work..
    Anyway, my stream is found but i get a org.davic.net.tuning.NotTunedException.
    Here's a piece of my code:
    public void playVideo() {
    targetVideo = new MediaLocator(dvb://1.438.1);
    player = javax.media.Manager.createPlayer(targetVideo);
    player.addControllerListener(this);
    scalingControl = (org.dvb.media.BackgroundVideoPresentationControl) player.getControl("org.dvb.media.BackgroundVideoPresentationControl");
    player.start();
    transformation = new VideoTransformation();
    transformation.setScalingFactors((float)0.5, (float)0.5);
    transformation.setVideoPosition(new HScreenPoint((float)0.5, (float)0.0));
    transformation = scalingControl.getClosestMatch(transformation);
    result = scalingControl.setVideoTransformation(transformation);
    player.stop();
    player.deallocate();
    catch (Exception e){
    System.out.println("Exception thrown while using the JMF Player:");
    e.printStackTrace();
    I was wondering if there is way to get this run without using the service selection API or Tuning API?
    Hopefully someone has an idea or is able to explain me why this won't work!!!
    Thanks in advance,
    with best regards,
    Alex.

    Hello Steve!
    First of all, thank you for trying to help me out!
    I tried the code i posted above (using BackgroundVideoPresentationControl and a quarter sized video area in the upper right corner).
    The NullPointer is thrown at the following line:
    transformation = scalingControl.getClosestMatch(transformation);
    I also tried other positions and video sizes but nothing worked at all..
    For at least quarter size video should be supported i am not quite sure where the problem is..
    As i said i also tried AWTVideoSizeControl with something like:
    source = new Rect(0,0,320,288);
    dest = new Rect(source.getBounds());
    videoSize = new AWTVideoSize(source,destination);
    When i do something like:
    transformation.setVideoSize(videoSize);
    i get a NullPointer too!
    Do you have any ideas what my problems might be?
    Thanks in advance,
    with best regards,
    Alex.
    P.S.:
    My *.ts-File was captured with a DVB-Card and contains 6 Services (that only contain TV-programs). For i am not able to test it by now (because i don't see any video ;-( ) i have another question (Because i am a little bit confused concerning service selection):
    Is it possible to play the different services of my ts-File (that's on my HDD) with the JMF , or do i 0have to use the service selection API for adressing the different streams (or services)? I guess this is not necessary for i can just set a parameter in the
    line:
    targetVideo = new MediaLocator(dvb://1.438.3);
    that describes the service (3 in that case). Am i right or am i really really confused and a hopeless case??
    Thanks again,
    with very best regards,
    Alex.

  • Flash Player on Android, select multiple files

    We have a web app that uses a flash uploader and it works on Android phones and tablets but it will not let us select multiple files on these devices. Is this possible or is there a trick to get these devices to allow us to select more than one file at a time?
    Thank you,
    Keith

    Flash Player for Android is no longer available. For more information, see here:
    http://blogs.adobe.com/flashplayer/2012/06/flash-player-and-android-up date.html
    Android users can still download and install Flash Player from the Archived Flash Player Versions page on the Adobe website.
    Please refer : http://forums.adobe.com/thread/1061194
    Please see this page for a list of all certified devices:Flash Player Certified Devices

  • How to get Music Player to play AAC files and show...

    I feel the need, the need to share my recent experiences with you! Firstly to restate the already known facts: The Nokia Audio Manager in PC Suite is incapable of reading any tags as far as I have seen, from a tag (AAC/MP3) or from a CD itself and it crashes on my pc after sending 2 albums to my phone or on initialising once the phone has 2 albums already on it - so I've binned that. iTunes creates .m4a files which are AAC files but in mp4 containers with mp4 tags. The N70 will play AAC files and read ID3 tags up to v2.3 Here's how to get musak on your N70 with tags and artwork. 1. get yourself copies of dbpoweramp 11.5, their AAC codec (the Release 5 one) and The Godfather and install them 2. Go into the dbpoweramp config, select the ID tag tab and change the tag to ID3V2 for AAC. check the version field is set to v2.3 3. Use Poweramp's CD Input to rip a CD (you can specify under options to use AAC (Advanced Audio Coding (CLI)), you can custom the folder/filenames and set the bitrate (I use 100 BVR which creates files about the same size as MP3) 3.5. Rename any file that has an apostrohpe in the filename - removing the apostrophe - as the Music player will not read the tag 4. Go onto Amazon.com, find your CD and save the artwork image to your PC (create a folder for artwork) 5. Run The Godfather, select the folder containing the ripped album, click on the 'TAG' button, tick the picture box and click the button to it's right and browse for the .jpg file you just downloaded. then click on Update which will bring up the edit dialog, check that the picture is visible at bottom right and is ticked and then click 'Update All', then 'Sync' and then 'Exit'. Finally, click on the 'Apply' button 6. Transfer the folder to your My Music folder on the MMC 7. Run the Music Player and select Options-Update Collection 8. Now go into Albums and you should see your album title. Click on it and you should see all tracks. Click on a track and you should see, in the playing window, the artist & track and the artwork too. It has taken me weeks to get this far but for me, it is worth it. I hope this system works for you too Regards, Brian.

    It sounds like a dud program.   I would remove it (highlight its icon, then Options -> Remove).  If you don't see a remove option, look for the program in the Application Manager.

Maybe you are looking for