JMF Pause

Hello!
I will start by saying i'm only a begginer in JMF programming. I want to make a pause function, which teoretically is very simple to make but i don't know why, it seems like it only works with some songs, and with others it doesn't. I mean, it works playing all of them from the beginning, but when i try pausing them, with some it doesn't work. And always the same songs, so it's not some mistake i made (maybe it is, but a more complex one, that's why i need your help). So the code for my music file:
public class MP3V2 {
URL url;
Player audioplayer;
boolean paused;
Time resume;
public MP3V2(URL u){//for starting from the beginning
try{
url=u;
audioplayer=Manager.createRealizedPlayer(url);
} catch(Exception e){}
public MP3V2(URL u,Time time){ //for resume
try{
url=u;
audioplayer=Manager.createRealizedPlayer(url);
audioplayer.setMediaTime(time);
} catch(Exception e){}
public void stop(){
if(audioplayer!=null) audioplayer.stop();
public void start(){
new Thread(){
public void run() {
try {
audioplayer.start();
catch (Exception e) { System.out.println(e.getMessage()); }
}}.start();
And the code for pause:
try{
if(paused==0) {
time= mp3.audioplayer.getMediaTime();
mp3.stop();
paused=play;
play=0;//some variables i need
else {
mp3 = new MP3V2(files[paused].toURL(),time);
mp3.start();
play=paused;
paused=0;
} catch(Exception e) {System.out.println(e.getMessage());}
In other words when i resume i actually start a new song but not from the beginning. The problem is that with some songs, the track remains stuck at the setting time, even after using start() method. Do you know what do i do wrong, or do you know a simpler way to make a pause function?

In order for that approach to work, the DataSource has to be Positionable... which some are not.
I believe some people have had sucess in the past implementing pause by stopping and then just calling start again...

Similar Messages

  • PAUSE RTSP command with JMF

    Hello !
    How can I manage a PAUSE command with my client code to address a remote streaming server (using RTSP protocol given with JMF 2.1.1e).
    Thanks

    Actually there is a whole body of code dedicated to RTSP... the only problem is that it is undocumented. There is an RtspManager, RtspPort, MessageProcessor, even a Server and more all hidden away in com.sun.media.rtsp. Download the source code and look it up.
    However if you are not willing to make that much of an effort you could just tell me exactly what you need and I'll dredge it up.

  • How to draw 2D shapes on the image generated by JMF MediaPlayer?

    Hello all:
    IS there any way that we can draw 2D shapes on the image generated by JMF
    MediaPlayer?
    I am currently working on a project which should draw 2D shapes(rectangle, circle etc) to
    mark the interesting part of image generated by JMF MediaPlayer.
    The software is supposed to work as follows:
    1> first use will open a mpg file and use JMF MediaPlayer to play this video
    2> if the user finds some interesting image on the video, he will pause the video
    and draw a circle to mark the interesting part on that image.
    I know how to draw a 2D shapes on JPanel, however, I have no idea how I can
    draw them on the Mediaplayer Screen.
    What technique I should learn to implement this software?
    any comments are welcome.
    thank you
    -Daniel

    If anyone can help?!
    thank you
    -Daniel

  • JMF Control bar

    Hello,
    I'm still quite new to java .. but i like figuring new thing out.
    My question is about the control panel in the JMF, when you play a media file the ( Pause, Stop, etc ) buttons..
    is there anyway to customize the look and feel of that bar ?
    Also i would like to know if i can get control over the Pause, Stop and Seek bar methods from the player object so i can make my own control panel.
    As the default control panel is initiated by
    playerObject.getControlPanelComponent()i have no control over the pause, stop, etc buttons.
    Thanks in advance.

    [http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/CustomGUI.html]

  • Problem with source of JMF

    I downloaded the source code of JMF and I put the directories "com", "javax" inside the "src" directory of my project but now I have some problem:
    Enumeration enum = devices.elements();
    and the error message is that is not possible to resolve enumeration, but I haven't message error when I import it.
    Keep in mind that in eclipse I found enum in red bold, it should mean something
    Ciao
    THX
    Marco

    do you want to get the media components?
         // Visual content component to show a video
         private Component visualMedia;
         // Media control component. play, stop and pause
         private Component mediaControl;
         // Main container
         private Container container;
         //*...some code...*
         // obtains the visual controller for the media player
         public void getMediaComponents() {
              // obtains the visual media components,
                    // and returns null if is an audio media type
              visualMedia = player.getVisualComponent();
              // if exists, add the visual component
              if (visualMedia != null)
                   container.add(visualMedia, BorderLayout.CENTER);
              // obtains the GUI
              mediaControl = player.getControlPanelComponent();
              // if exists, add the media visual controller
              if (mediaControl != null)
                   container.add(mediaControl, BorderLayout.SOUTH);
         } // getMediaComponents endEdited by: cassioso on Nov 27, 2007 9:53 AM

  • 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

  • Audio Video Conference application with JMF

    hi there!
    I am developing an "Audio Video Conference application". so far I've been able to develop an applicaiton which opens an RTP Player on the client side, now my purpose is to enhance the functionality of RTP player by adding various functions like "Quit", "Pause" etc. I am looking for more options for enhancing the functionality of the RTP player in order to make it more user friendly for example I've been able to find the method for quiting from the player which is "KillThePlayer()" it is found in the class "PlayerWindow".
    java.lang.Object
    |
    --java.awt.Component
    |
    --java.awt.Container
    |
    --java.awt.Window
    |
    --java.awt.Frame
    |
    --com.sun.media.ui.PlayerWindow
    |
    --RTPPlayerWindow
    Please suggest me some of the classes and methods where I can find the method(s) for "Pausing the player" by which the player stops recieveing data and when un-paused it again starts recieveing, and also suggest me more functions to add to the RTP player so as to make it more user friendly.

    hi!
    thanx, I appreciate your interest! i know i am hitting the wrong forum but i have also posted my query in the JMF forum, i waited for long but unfortunately there was no reply posted to my request, so i just thought why not to try on some other relevant forums.
    if there is any sort of refernce available to my topic please help me.
    thanx for your help,
    bbye!

  • [THE Forum] Audio recording with Java / JMF

    Hello,
    I would like to gather any useful information about audio recording. I've worked on this area for months now and I am still facing many problems, namely:
    Can't record on linux with JMF,
    Can't pause on linux with JMF,
    Problems when two soud cards are on the PC,
    Problems with Windows NT,
    When using the pause feature, the sound is transformed while recording a song.
    If you have any quesitons, I'll try to answer. If you are the solution to one of these problems please let me know.
    For the sound cards problem, when disabling one of the sound card it works.

    Hi!
    I'm developing a videoconferencing application on Linux and I can't
    capture sound. I get messages like these: "Couldn't initialize audio device" or "java.io.IOException: Cannot open audio device for input."
    My system: RedHat 7.3, J2SDK1.4.1, JMF2.1.1.c and SoundBlaster audio card.
    Could you tell me how have you configured your system or how have you got capturing sound?
    Thankyou.

  • Sound problem while transimission over the network by using JMF API

    i had done an application which transmit audio and video over the network by using JMF API in JAVA. All my application work very well but i have a problem with the sound while i transmit it. this sound has a very bad quality (i am using AVReceive2.java) .
    has anyone an indication or solution for my problem
    it's very urgent, please help me.
    regards
    sar

    you can try modifing de Capture example from JMF Solutions.
    change this function:
    public int startCapture() {
         int result = -1;
         enableComponents(false);
         buttonStart.setLabel("Pause");
         buttonEnd.setEnabled(true);
         startMonitoring();
         try {
    processor.start();
    DataSource clone = Manager.createCloneableDataSource(datasource);
         MediaLocator ml2 = new MediaLocator("file://capture.mov");
    System.out.println("Content Type " + clone.getContentType());
    datasink = Manager.createDataSink(processor.getDataOutput(), ml2);
         datasink.open();
    datasink.addDataSinkListener(this);
         datasink.start();
    result = 0;
         } catch (Exception e) {
         System.err.println("DataSink Exception " + e);
    result= -1;
    Regards.
    Fernando

  • Is JMF the right technology for this...

    Hi All!
    I have a requirement to build a client app that is subscribed to a JMS topic. Based on the published message, the client has to select and play the appropriate video clip from a total of n video clips. Here are my questions:
    1) Is JMF the right technology to play video clips (.AVI format)? What are the alternatives?
    2) Can I have these play in full-screen mode?
    3) During idle time, can I display a default image (.JPEG)?
    4) Does Swing or AWT have to also be used?
    5) How can I cache the video clips (16MB * 6 clips) in memory to make it more performant? Is this even neccessary?
    6) I need this application to run 24*7 with minimum failure rate. Is this a realistic expectation for JMF?
    thanx much!
    - Ravi

    1. yes. depends on what you want to do exactly.
    2. why not?
    3. what is "idle time"? you mean the time where your video pauses? yes, you can..
    4. doesn't matter. The visual component which you'll get from jmf (to show video) is of type java.awt.Component
    5. this is not neccessary. You would reach nothing with caching video in memory. Actually, you didn't say if you are talking about sender, server or recipient side..
    6. no. I generally don't trust Applets very much. I would use Macromedia Flash with FlashCom server then, although it has less features and parameters, but it seems to be more stable.
    Best regards from Germany,
    r.v.

  • JMF sending video in HTC Dream

    Hi,
    I am new to JMF. I am able to send video file successfully from PC to PC using the sample source code at JMF website with ease.
    However i am having difficulty transferring Video file from HTC Dream android to my PC. it jumped out of the try-catch without exception at
    MediaLocator locator = new MediaLocator("file://sdcard/aa.3gp");
    ds = Manager.createDataSource(locator); <--- error happened here!
    My media file is aa.3gp and is stored in my Android phone's sdcard.
    Anyone can help ?
    Warmest Regards
    Whitetaru

    Hi,
    Thanks for the great information, However, even if i changed the aa.3gp to another file .mov. It still gives the same error.
    The path /sdcard/<myfile> is correct as i have written other program to save movie file into the sdcard. I've been scratching my head for a few days, just no idea how to resolve this error. Think getting bald soon :)
    Well, wonder if the below debug message would be helpful: The error should be after "WARN/ActivityManager(65)"....
    09-16 13:36:07.314: INFO/StubService(1111): into handleInternalConn!!! isNetworkConnected:true
    09-16 13:36:07.314: INFO/StubService(1111): username not null:falsepassword not null:false
    09-16 13:36:37.964: WARN/AudioFlinger(37): write blocked for 127 msecs
    09-16 13:36:42.394: WARN/InputManagerService(65): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@437b3da8
    09-16 13:36:43.164: INFO/jdwp(65): received file descriptor 103 from ADB
    09-16 13:36:43.184: INFO/jdwp(100): received file descriptor 11 from ADB
    09-16 13:36:43.194: INFO/jdwp(102): received file descriptor 51 from ADB
    09-16 13:36:43.204: INFO/jdwp(145): received file descriptor 59 from ADB
    09-16 13:36:43.224: INFO/jdwp(277): received file descriptor 31 from ADB
    09-16 13:36:43.234: INFO/jdwp(999): received file descriptor 24 from ADB
    09-16 13:36:43.244: INFO/jdwp(1008): received file descriptor 25 from ADB
    09-16 13:36:43.254: INFO/jdwp(1111): received file descriptor 24 from ADB
    09-16 13:36:43.264: INFO/jdwp(1182): received file descriptor 33 from ADB
    09-16 13:36:43.284: INFO/jdwp(1237): received file descriptor 32 from ADB
    09-16 13:36:43.294: INFO/jdwp(1285): received file descriptor 24 from ADB
    09-16 13:37:11.064: INFO/jdwp(1330): received file descriptor 23 from ADB
    09-16 13:37:16.474: INFO/PackageManager(65): Removing non-system package:com.pandvt
    09-16 13:37:16.974: INFO/PackageManager(65): /data/app/vmdl37043.tmp changed; unpacking
    09-16 13:37:24.754: INFO/installd(39): move /data/dalvik-cache/data@[email protected]@classes.dex -> /data/dalvik-cache/data@[email protected]@classes.dex
    09-16 13:37:25.204: INFO/dalvikvm(1330): Debugger has detached; object registry had 1 entries
    09-16 13:37:26.084: INFO/ActivityManager(65): Start proc com.android.voicedialer for broadcast com.android.voicedialer/.VoiceDialerReceiver: pid=1340 uid=10004 gids={3002}
    09-16 13:37:26.104: WARN/ResourceType(65): No package identifier when getting value for resource number 0x7f060001
    09-16 13:37:26.194: INFO/jdwp(1340): received file descriptor 11 from ADB
    09-16 13:37:26.264: WARN/ResourceType(65): No package identifier when getting value for resource number 0x7f060001
    09-16 13:37:27.944: INFO/ActivityManager(65): Stopping service: com.android.vending/.PackageMonitorReceiver$UpdateCheckinDatabaseService
    09-16 13:37:30.144: INFO/CheckinService(65): Checkin triggered: Intent { action=android.server.checkin.CHECKIN (has extras) }, market only = true
    09-16 13:37:30.164: INFO/CheckinService(65): Checkin triggered: Intent { action=android.server.checkin.CHECKIN (has extras) }, market only = true
    09-16 13:37:30.524: INFO/CheckinService(65): Sending checkin request (1916 bytes)...
    09-16 13:37:30.574: INFO/CheckinService(65): Sending checkin request (1916 bytes)...
    09-16 13:37:30.644: INFO/jdwp(1348): received file descriptor 23 from ADB
    09-16 13:37:31.394: INFO/ActivityManager(65): Starting activity: Intent { flags=0x10000000 comp={com.pandvt/com.pandvt.pandvt} }
    09-16 13:37:31.454: INFO/dalvikvm(1348): Debugger has detached; object registry had 1 entries
    09-16 13:37:31.564: INFO/ActivityManager(65): Start proc com.pandvt for activity com.pandvt/.pandvt: pid=1357 uid=10057 gids={1006}
    09-16 13:37:31.624: INFO/jdwp(1357): received file descriptor 11 from ADB
    09-16 13:37:31.754: WARN/ActivityThread(1357): Application com.pandvt is waiting for the debugger on port 8100...
    09-16 13:37:31.774: INFO/System.out(1357): Sending WAIT chunk
    09-16 13:37:31.944: INFO/dalvikvm(1357): Debugger is active
    09-16 13:37:32.034: INFO/System.out(1357): Debugger has connected
    09-16 13:37:32.064: INFO/System.out(1357): waiting for debugger to settle...
    09-16 13:37:32.264: INFO/System.out(1357): waiting for debugger to settle...
    09-16 13:37:32.464: INFO/System.out(1357): waiting for debugger to settle...
    09-16 13:37:32.664: INFO/System.out(1357): waiting for debugger to settle...
    09-16 13:37:32.864: INFO/System.out(1357): waiting for debugger to settle...
    09-16 13:37:33.064: INFO/System.out(1357): waiting for debugger to settle...
    09-16 13:37:33.274: INFO/System.out(1357): waiting for debugger to settle...
    09-16 13:37:33.474: INFO/System.out(1357): waiting for debugger to settle...
    09-16 13:37:33.674: INFO/System.out(1357): waiting for debugger to settle...
    09-16 13:37:33.874: INFO/System.out(1357): debugger has settled (1409)
    09-16 13:37:41.444: WARN/ActivityManager(65): Launch timeout has expired, giving up wake lock!
    09-16 13:37:41.894: WARN/ActivityManager(65): Activity idle timeout for HistoryRecord{43537058 {com.pandvt/com.pandvt.pandvt}}
    09-16 13:37:42.954: WARN/ActivityManager(65): Activity pause timeout for HistoryRecord{43537058 {com.pandvt/com.pandvt.pandvt}}
    09-16 13:37:43.544: INFO/CheckinService(65): From server: Intent { action=android.server.checkin.FOTA_CANCEL }
    09-16 13:37:43.654: INFO/CheckinService(65): From server: Intent { action=android.server.checkin.FOTA_CANCEL }
    09-16 13:38:17.264: WARN/dalvikvm(1357): VFY: unable to resolve static field 1660 (PROPERTY) in Lcom/ms/security/PermissionID;
    09-16 13:38:17.264: WARN/dalvikvm(1357): VFY: rejecting opcode 0x62 at 0x012e
    09-16 13:38:17.264: WARN/dalvikvm(1357): VFY: rejected Lcom/sun/media/util/Registry;.<clinit> ()V
    09-16 13:38:17.264: WARN/dalvikvm(1357): Verifier rejected class Lcom/sun/media/util/Registry;
    09-16 13:38:17.304: WARN/dalvikvm(1357): Exception Ljava/lang/VerifyError; thrown during Ljavax/media/pm/PackageManager;.<clinit>
    09-16 13:38:17.324: WARN/dalvikvm(1357): Exception Ljava/lang/ExceptionInInitializerError; thrown during Ljavax/media/PackageManager;.<clinit>

  • Problem in JMF

    Hai Friends
    I am doing a video player using JMF. I want to get the total time for the mpg file in 00:00:00 format , how to get this. also how to pause a player

    If you're asking how to get the time taken:
    http://www.google.co.za/search?hl=en&q=%2Bjmf+%2Bmpeg+%2Bduration&meta=
    If you have the time it takes and want it formatted:
    http://www.google.co.za/search?hl=en&q=%2Bjava+%2Bformat+%2Btime&meta=

  • How to differentiate bw play, pause n seek buttons in TypicalPlayer Applet?

    hi all,
    I managed to get th frame extracted from avi video by listenin to ControlListener Event... Now my prob is tat whwnever i click any button either play, pause,seek the same event is invoked... How to differentiate between these events????? Can anyone help....

    I managed to get th frame extracted from avi
    video by listenin to ControlListener EventDo you mean[b] ControllerListener and ControllerEvent,
    or are you refering to some other API that is not JMF?
    How to differentiate between these events????? Did you spill jam on that '?' key?
    ..In any case, to distinguish between the events,
    you might try something like this./**
    * Controller Listener.
    public void controllerUpdate(ControllerEvent evt) {
      if (evt instanceof ConfigureCompleteEvent ||
        evt instanceof RealizeCompleteEvent ||
        evt instanceof PrefetchCompleteEvent) {
          synchronized (waitSync) {
            stateTransitionOK = true;
            waitSync.notifyAll();
      } else if (evt instanceof ResourceUnavailableEvent) {
        synchronized (waitSync) {
          stateTransitionOK = false;
          waitSync.notifyAll();
      } else if (evt instanceof EndOfMediaEvent) {
        evt.getSourceController().stop();
        evt.getSourceController().close();
    } From JpegImagesToMovie.java

  • Clip question - stopping and pausing

    I use the Clip objects to play sounds. When the clip reaches its end, when I call its start() method, it doesn't play. It turned out that its frame position is set to the last one, so in fact it plays, but ends immedietaly. So I figured out to add a LineListener, and if the Type == STOP, I set the frame position to 0. But in this manner, when I call my pause method:
    public void stop(Clip c) {
        c.stop();
        c.setFramePosition(0);
    public void pause(Clip c) {
        c.stop();
    }it also generates the STOP event, and repositions to the beginning. Does anybody have any idea how to go about it?

    MediaPlayer has the methods saveMediaTime() and restoreMediaTime() for pausing and starting the media playing. Have a look through the documentation and see if Clip has these. Otherwise you could try using JMF's MediaPlayer (but I don't know how that would affect your app. or the sound)...
    Alastair

  • JMF and keylistener

    I guys, i'm new in jmf (fobs)world. I have coding a simple video player. My question is:
    is it possible to stop/play/pause the video whit keyboard? I'm thinking about keylistener but while the video is playing i can't I am not able to access the function to stop the video flow (is JMF blocking?).
    thanks in advance and sorry for my bad English
    regards.
    emanuele

    post your JMF question on that forum:
    http://forum.java.sun.com/forum.jspa?forumID=28

Maybe you are looking for

  • How do I store the values in the @D array in the below mentioned VI? Only the last row in the Array is populated with values from the image.

    Hello Guys, I am trying to build a sinogram from 180 projection images and I am not able to store the summed values into the array as it is moving the values and then populating all the rows except for the last with ZERO. Thanks in advance. Attachmen

  • SOAP request being sent only half sometimes

    Hi All, Sometimes, the SOAP request being sent (By Clicking a Button) has all the fields filled with data like say for example, <doc:contact>                   <gen:gender>Female</gen:gender>                   <gen:firstName>FNAME</gen:firstName>    

  • Mt_shm_init: can't create virtual segment

    Hi, I'm running informix5 on solari26. I installed informix7 on the same system. When I tried to startup inf7, I got the following error: 16:31:38 shmat: [EMFILE][24]: out of shared memory segments, check system SHMSEG 16:31:38 mt_shm_init: can't cre

  • Download slow.

    Hi, My internet is really slow atm, should be getting 15, only getting 2.  We had a network specialist come to fix it and he got it to that speed. But at the moment it is only pulling upto 5. How do i fix this?

  • Mail.app says I have more messages than exist

    I'm having an issue with Mail.app pointing to the gmail server using IMAP (default automatic setup) Right now I have 3 messages in my inbox, all read. Mail.app's title says "Inbox (4 messages)" even though I have 3. It's off by 1 every now and then a