Filelocking and JMF player

Hello,
I am making a JMF player. However it is my requirement that while the video is being played, the video file may not be copied (through windows explorer) to some other location. I understand there are filelocking capabilities in Java.However those require that the file be opened using a FileInputStream and then access is only permitted through that stream.However JMF player do not take the stream as input.So how do I go about doing this.Please Help
Thanks,
Mohit

Welcome to the Sun forums.
wizzo wrote:
..I am making a JMF player. However it is my requirement that while the video is being played, the video file may not be copied (through windows explorer) to some other location. .. That is a very odd requirement for a player. It seems you want to throw in abilities normally found in a file manager app. (or something of that nature).
..I understand there are filelocking capabilities in Java.However those require that the file be opened using a FileInputStream and then access is only permitted through that stream.Are you sure about that? I am not that experienced with FIS and file locking abilities, but it surprises me that a FIS would do that. And as an aside, ultimately the player would probably turn a File into a FIS, if that is the case, and FIS locks the File, the job is done automatically.
BTW - please put a couple of spaces between each and every sentence. Putting the spaces helps the reader to quickly scan the text, looking for questions(1) and ways to help. You would not want to make it harder to help, would you?
..However JMF player do not take the stream as input.Off the top of my head. How about this? Use the FIS to create a copy of the file in the java.io.tempdir, then run the player using the temporary file.
..So how do I go about doing this.1) Is that a question? If so, please don't forget to add a question mark, for the same reasons as putting spaces between sentences.
..Please HelpThere is not need to ask people to help. If they want to help and are capable of doing so, they will help. If not, then no amount of pleading will change that. Also, it makes you appear 'needy', which is something that discourages people from even trying to help in the first place.

Similar Messages

  • 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
    ;)

  • How to load JMF player in web without applet

    Is it possible to load JMF player in html or php page without the help of applet or jsp or jsf?
    I heared that flash can be handy for this purpose as java can be loaded in flash movie, can anyone give me better idea about this?

    I don't know much about flash, but "loading java in flash movie" doesn't sound like something that makes sense. Flash does video, but you'll have to go to a Flash forum for more info on that :)
    Your options for Java solutions are an Applet or launching an application via Java Web Start (see posts about that and JMF, there's caveats).

  • Software error (outside VM) when calling JMF Player::close()

    First off, I apologize for cross posting this here and in the "General Java Programming" forum. I did not know there was a forum specific for JMF, until someone mentioned it to me.
    I have written the following test program:
    import java.io.File;
    import java.io.IOException;
    import javax.media.Time;
    import javax.media.Player;
    import javax.media.Manager;
    import javax.media.NoPlayerException;
    class MyMP3Player {
    public static void main(String [] args) {
    try {
    File mp3File = new File("test.mp3");
    Player aPlayer = Manager.createPlayer(mp3File.toURL());
    aPlayer.start(); // Starts asynchronous playback
    Thread.sleep(10*1000); // Allow playback to continue for 10
    aPlayer.stop(); // stops playback (well, it really PAUSES!!!)
    aPlayer.deallocate();
    aPlayer.close();
    catch (IOException e) {e.printStackTrace();}
    catch (NoPlayerException npe) {npe.printStackTrace();}
    catch (InterruptedException ie) {ie.printStackTrace();}
    The program runs fine for the first 2 times: I can hear the first 10 seconds of the test.mp3 file. Then, on the third run (and every other run after that), after it has played the file for the 10 seconds, the program gives me the error pasted below and exits. Does anyone know how to fix this? Am I doing something wrong in the program? Oh, and yes, I have tested it with other mp3 files and it still does the same thing.
    BTW, I am running WinXP, and JMF 2.1.1e . Also, I have noticed that JMStudio does not have this problem, does JMStudio not call Player::close() ever?
    ===== ERROR BEGINS HERE =====
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x73F91D04
    Function=[Unknown.]
    Library=(N/A)
    NOTE: We are unable to locate the function name symbol for the error
    just occurred. Please refer to release documentation for possible
    reason and solutions.
    Current Java thread:
    at com.sun.media.amovie.ActiveMovie.dispose0(Native Method)
    at com.sun.media.amovie.ActiveMovie.dispose(ActiveMovie.java:329)
    at com.sun.media.amovie.AMController.doClose(AMController.java:632)
    - locked <029F77C8> (a java.lang.Integer)
    at com.sun.media.BasicController.close(BasicController.java:261)
    at com.sun.media.BasicPlayer.doClose(BasicPlayer.java:229)
    at com.sun.media.content.video.mpeg.Handler.doClose(Handler.java:158)
    at com.sun.media.BasicController.close(BasicController.java:261)
    at MyMP3Player.main(MyMP3Player.java:30)
    Dynamic libraries:
    0x00400000 - 0x00406000 C:\WINDOWS\system32\java.exe
    0x77F50000 - 0x77FF9000 C:\WINDOWS\System32\ntdll.dll
    0x77E60000 - 0x77F45000 C:\WINDOWS\system32\kernel32.dll
    0x77DD0000 - 0x77E5B000 C:\WINDOWS\system32\ADVAPI32.dll
    0x77CC0000 - 0x77D35000 C:\WINDOWS\system32\RPCRT4.dll
    0x77C10000 - 0x77C63000 C:\WINDOWS\system32\MSVCRT.dll
    0x6D340000 - 0x6D46A000 C:\Program Files\Java\j2re1.4.1_02\bin\client\jv
    m.dll
    0x77D40000 - 0x77DCD000 C:\WINDOWS\system32\USER32.dll
    0x77C70000 - 0x77CB0000 C:\WINDOWS\system32\GDI32.dll
    0x76B40000 - 0x76B6C000 C:\WINDOWS\system32\WINMM.dll
    0x6D1E0000 - 0x6D1E7000 C:\Program Files\Java\j2re1.4.1_02\bin\hpi.dll
    0x6D310000 - 0x6D31E000 C:\Program Files\Java\j2re1.4.1_02\bin\verify.dl
    l
    0x6D220000 - 0x6D239000 C:\Program Files\Java\j2re1.4.1_02\bin\java.dll
    0x6D330000 - 0x6D33D000 C:\Program Files\Java\j2re1.4.1_02\bin\zip.dll
    0x10000000 - 0x10015000 C:\WINDOWS\system32\jmutil.dll
    0x0AFA0000 - 0x0AFAD000 C:\WINDOWS\system32\jmam.dll
    0x771B0000 - 0x772CA000 C:\WINDOWS\system32\ole32.dll
    0x5AD70000 - 0x5ADA4000 C:\WINDOWS\system32\uxtheme.dll
    0x76FD0000 - 0x77048000 C:\WINDOWS\system32\CLBCATQ.DLL
    0x77120000 - 0x771AB000 C:\WINDOWS\system32\OLEAUT32.dll
    0x77050000 - 0x77115000 C:\WINDOWS\system32\COMRes.dll
    0x77C00000 - 0x77C07000 C:\WINDOWS\system32\VERSION.dll
    0x72D20000 - 0x72D29000 C:\WINDOWS\system32\wdmaud.drv
    0x72D10000 - 0x72D18000 C:\WINDOWS\system32\msacm32.drv
    0x77BE0000 - 0x77BF4000 C:\WINDOWS\system32\MSACM32.dll
    0x77BD0000 - 0x77BD7000 C:\WINDOWS\system32\midimap.dll
    0x73F10000 - 0x73F65000 C:\WINDOWS\system32\DSOUND.DLL
    0x73EE0000 - 0x73EE4000 C:\WINDOWS\system32\KsUser.dll
    0x6D000000 - 0x6D105000 C:\Program Files\Java\j2re1.4.1_02\bin\awt.dll
    0x73000000 - 0x73023000 C:\WINDOWS\system32\WINSPOOL.DRV
    0x76390000 - 0x763AA000 C:\WINDOWS\system32\IMM32.dll
    0x76C90000 - 0x76CB2000 C:\WINDOWS\system32\imagehlp.dll
    0x6D510000 - 0x6D58C000 C:\WINDOWS\system32\DBGHELP.dll
    0x76BF0000 - 0x76BFB000 C:\WINDOWS\system32\PSAPI.DLL
    Local Time = Wed May 28 09:46:23 2003
    Elapsed Time = 19
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.1_02-b06 mixed mode)
    # An error report file has been saved as hs_err_pid180.log.
    # Please refer to the file for further information.

    Actually, I just ran another test. My previous fix does work 100%, but it is not necessary to call the Player::close() from within the AWT/SWING event dispatching thread, but it IS a requirement for you to have an AWT/SWING event dispatching thread running somewhere in the background, otherwise the darn thing crashes...
    So, if you create some kind of GUI along with your app (thereby creating an AWT/SWING event dispatching thread), or just schedule some event using the SWING Timer class, the Player::close() can be called from any thread...
    Hobbieman

  • Adobe Reader 11.0.03 and Flash Player 11.8.800.94 Not Working on Windows 8

    On a computer running Windows 8 Enterprise, Adobe Reader 11.0.03, and Flash Player 11.8.800.94, I am unable to open a flash-enabled PDF.  Reader gives me the error "To view the Flash technology content in this PDF file, please install this version of Flash Player that supports Adobe Reader and Acrobat."  Adobe's Flash verification page shows me that Flash Player is working, and I can open other basic PDFs in Reader.  I have another machine with an identical setup, except that it has Acrobat 11.0.03 instead of Reader, and the PDF opens just fine on that machine.  Why won't Reader open the Flash-enabled PDF?

    http://helpx.adobe.com/acrobat/kb/reader-acrobat-flash-player-download.html

  • Getting Big Headache, What is difference between Flash Lite 3.1 and Flash Player 7

    Hello, I am asking questions about the two similar yet different programs for Pocket PC version only:
    1) Which came first, Flash Lite 3.1 or Flash Player 7?
    2) If I have both in my Pocket PC, will there be product incompatibility?
    3) What is the difference between Flash Lite 3.1 and Flash Player 7.
    4) I have a Flash Lite 3.1 but uninstall information says "Flash Lite 3.1 for Opera Mobile", did you releaase this? Is this an illegal copy? A developer's copy?
    *I don't know exactly where I got it, but I got it from the HTC developer's forum: XDA-developers.com
    *I also use Opera mobile, a web browser for Pocket PC's.
    5) What is difference between Flash Lite 3.1 and Flash Lite 3.1 for Opera? Is the only difference is that Flash Lite Supports everything flash related, while Flash Lite Opera supports only flash in opera?
    Hi, I don't expect all answers, but I hope someone or someone from adobe support can clear some things up for me.

    The program under my "remove programs" list is specifically called "Adobe Flash Lite for Opera". The XDA forums people said along time ago that it was Flash Lite, and kept calling it Flash Lite, and not Flash Player 7.
    Now what about this:
    http://www.adobe.com/products/flashlite/version/
    The table shows the differences between FP 7 SDK, FL 2.1, and FL 3.1. And it's quite obvious that FL 3.1 has way more features than Flash Player 7. What does SDK mean? And why are you telling me FP 7 has more features?
    With this information, can you or anyone else provide any more details and clarification?

  • How can we update or manage the Adobe Product for example Adobe Reader and Flash Player in a enterprise environment.  Enterprise lifecicle management

    We want to maintenance the adobe products in the enterprise environment. Specially Update for he reader and players.
    Thanks

    You will need to apply for both Reader and Flash Player Distribution agreements if you intend on enterprise deployments of these products.
    Adobe - Adobe Runtimes / Reader Distribution License Agreement
    If you are using SCCM and SCUP then use the available catalogs for both products.
    11   SCCM-SCUP — Enterprise Administration Guide
    Flash Player enterprise deployment | Adobe Developer Connection

  • Adobe reader and flash player can't be installed any more on 10.8.5

    I am working with 10.8.5 since many months all right. After the last note from adobe to update my flash player i updated it as told. Unfortunately while installing there came a message "adobe installer was quit unexpected".
    I tried to uninstall the old version with the adobe uninstaller. I can not install this one also, same message.
    Now my reader and flash player don't work.
    How can i manage to install them again?
    Thanks for some help!! Mike

    Then post your question on the Adobe forums since it's their software you're having problems with.  This forum is for troubleshooting Apple Software Update for Windows, and not related to Adobe in any way...
    http://www.adobeforums.com

  • I can't get the websites like youtube, facebook, etc to load. everything comes up as just text/words. i've downloaded adobe flash and real player on windows xp.

    i have windows xp. i just got the computer and internet on it. i downloaded adobe flash and real player. but i still can't get sites like facebook and youtube to work. i always get popups that ask if its a trusted site and to add the exception, which i do. yahoo and msn work, i can see photos and pictures and images just fine, but facebook and youtube are still all just words and error messages. any suggestions besides what i've already tried? i'm not tech savvy so step by step is how i learn best!

    Check the date and time and time zone in the clock on your computer: (double) click the clock icon on the Windows Taskbar.
    Check out why the site is untrusted and click "Technical Details" to expand this section.
    If the certificate is not trusted because no issuer chain was provided (sec_error_unknown_issuer) then see if you can install this intermediate certificate from another source.
    You can retrieve the certificate and check details like who issued certificates and expiration dates of certificates.
    *Click the link at the bottom of the error page: "I Understand the Risks"
    Let Firefox retrieve the certificate: "Add Exception" -> "Get Certificate".
    *Click the "View..." button and inspect the certificate and check who is the <b>issuer of the certificate</b>.
    You can see more Details like intermediate certificates that are used in the Details pane.
    If <b>"I Understand the Risks"</b> is missing then this page may be opened in an (i)frame and in that case try the right-click context menu and use "This Frame: Open Frame in New Tab".
    *Note that some firewalls monitor (secure) connections and that programs like Sendori or FiddlerRoot can intercept connections and send their own certificate instead of the website's certificate.
    *Note that it is not recommended to add a permanent exception in cases like this, so only use it to inspect the certificate.

  • Help required with JSP and JMF

    Hi
    Please check the following thread and let me know if JSP and JMF can be combined together
    http://forum.java.sun.com/thread.jspa?threadID=5161428&tstart=0
    ~Aman

    take a look at the Java Upload bean and it's examples
    http://www.javazoom.net/jzservlets/uploadbean/uploadbean.html

  • New n97 v2 firmware and music player /firmware v2

    just wasted five hours manually updating album art on the n97 for albums thats artwork wasnt recognised using the album art/change function then as usual after being connected in mass storage mode refreshed the music library and it removed all the found artwork and some alterations to file names thanks a lot nokia for the five hours wasted tempted to send you an invoice for my time !!
     the only way round this ive found is to use nokia music to add files then theres no need to refresh the library
    but this is a pain as i already have most of my music in itunes and album player and when youre dealing with importing 3000+ tracks is terminally slow never mind having to optimise the artwork for the phone
    other than that apart from that am overall v pleased with the new firmware kinetic scrolling more mb on c drive
    and seems more stable having said that last night the phone was very nearly being repackaged and being sent back to nokia

    I use Mediamonkey to ID-3 tag all my music. This is what the media player uses to identify music titles and album art.
    With Mediamonkey, you simply drop and album into it, select search and it finds your album or you have the option of a manual search. Select save to Tag and It saves the album cover to the ID-3 tag and adds all relivant information such as
    Album name
    Album Artist
    Year
    Song titles
    Ttrack listings
    Record label
    I have used this software with my current N97 and previously on my N95 and other Sony Ericsson phones. I have over 16Gb of music currently on my N97 and all of it is tagged with the correct album art.
    Give it a go. This will solve your problem.

  • Static ip option in wifi and media player in notif...

    compare to other mobile os this two feature is need in windows phone ...microsoft should add static ip configuration and media player in the notification bar. so that user can easily chage and access he songs.
    if DHCP is not enable we can't access the wifi in windows phone so need to enable static ip configuration in windows phone...

    Your are not alone with that feature requirement. Please, continue there …
    dhanapal wrote:
    media player in the notification bar. so that user can easily chage and access he songs.
    Because that is a feature request, there you go …

  • How can I get my Panasonic 3D TV and BluRay Player to go online using Time Capsule?

    So I've extended my home network using my Time Capsule so that I have a stronger signal in different parts of my home. My Time Capsule isn't hard wired to the modem, but I'm now getting a stronger signal in parts of my house that never had good signal strength. That being said, I've set up my Time Capsule in my living room right next to my home theater system. I thought since Time Capsule is connected to the internet, I would be able to connect my 3D TV and BluRay player (both Panasonic) to it. I did wire connect the tv and BD player to the Time Capsule, but no connection is happening between the tv and BD player and net. Can anyone help me out a bit? Does the Time Capsule need to be hard wired to the modem for this to work?

    Let's check your settings first on the Time Capsule.
    Open AirPort Utility - Click Manual Setup
    Click the Wireless tab below the row of icons
    What setting do you see for Wireless Mode?
    What type of router (make / model number) is providing the "main" wireless network that the Time Capsule is trying to "extend"?

  • Im making a photo slide show using imovie. how will i make a dvd copy that can play in both pc and dvd player.  i dont have an idvd anymore. m using a mbp early 2011 osx 10.8.5

    im making a photo slide show using imovie. how will i make a dvd copy that can play in both pc and dvd player.  i dont have an idvd anymore. m using a mbp early 2011 osx 10.8.5.
    after making the photo slide show, i clicked share>export movie.  after which i burned using toast. the file became a .mov.  i tried playing it in my mac and it worked. my fear now is will it also play in a regular dvd?... i read from google that mov files won't run in dvd players.  what format should i convert it to so it'll play in a dvd player.  can you suggest a faster way i can burn my projects for it takes me almost an hour to export.  im going to make 28 slideshows for my kids in school. *=( if i need to do this process 28 times, i may not be able to finish it on time.  please suggest a software or an alternative as to how i should do this... m more comfortable using imovie than iphoto.  thanks and i hope to hear from someone soon *=j

    Thank you QuickTimeKirk...used toast to burn project... my project was in .mov, i tried to play it a dvd player, it did play... will try again tomorrow using another dvd player just to be sure it'll will really work with dvd players.  thank you again for your reply *=)

  • How do I update my iTunes because I accedently only updated iTunes and not iCloud thing and quicktime player. How do I do it?

    The window of iTunes updater popped up and I accedently only downloaded the iTunes and not iCloud thing and Quicktime player. Any ideas how I can download them now?

    Go "Start > All programs > Apple Software Update". When Apple Software Update launches, does it offer you the QuickTime and iCloud updates?

Maybe you are looking for

  • I can not access my files in time machine

    I am trying to restore a file from time machine. When I try to select the file in time machine, it is not accessible. I can not select anything. Only the folder that was selected when I started time machine is highlighted and can be restored but I ca

  • Win32 API Version 1.0

    Hi, I have just downloaded the "Win32 API Version 1.0 " and I am trying to compile it under the Solaris 2.6 and Forte 6.1/C++5.2/. I am facing some strange problems like socklen_t in Files.h not defined and so on. I don't know which version of Solari

  • Stream data from a subvi to the main vi

    Hi I'm wondering if someone can help me. I'm trying to stream data from a sub vi to the main vi without opening and closing the sub vi continuously. The data also needs to be extracted from a while loop within the sub vi.  background info: The sub vi

  • ICloud says I used more space than I actually do

    Hi, When I look in the pereferences of iCloud it says I used 3,77gb of the 5gb. When I look in "manage" the screen tells me I used not more than 1,5gb. what's happend? Ramon

  • How to remove soft deleted records?

    Hi everybody, Are there any ways to remove soft deleted records from LT table? For instance, table is versioned and database has few workspaces. The user removes some data from LIVe workspace (or from other workspaces). The removed records are marked