Package javax.media

Examples of javax.media.Time


        if (player == null) return;
       

        if (event instanceof EndOfMediaEvent) {
            // End of the media -- rewind
            player.setMediaTime(new Time(0));
        }
    }
View Full Code Here


    public synchronized void controllerUpdate(ControllerEvent event) {
        // If we're getting messages from a dead player, just leave
        if (player == null) return;

        if (event instanceof EndOfMediaEvent) {
            player.setMediaTime(new Time(0));
        }
    }
View Full Code Here

     *                 the media event
     */
    public void controllerUpdate(ControllerEvent event) {
        if (event instanceof EndOfMediaEvent) {
            // End of the media -- rewind
            player.setMediaTime(new Time(0));
        }
    }
View Full Code Here

      System.err.println("The player does not support FramePositioningControl.");
      System.err.println("There's no reason to go on for the purpose of this demo.");
      return false;
  }

  Time duration = p.getDuration();

  if (duration != Duration.DURATION_UNKNOWN) {
      System.err.println("Movie duration: " + duration.getSeconds());

      totalFrames = fpc.mapTimeToFrame(duration);
      if (totalFrames != FramePositioningControl.FRAME_UNKNOWN)
    System.err.println("Total # of video frames in the movies: " + totalFrames);
      else
View Full Code Here

      synchronized (waitSync) {
    stateTransitionOK = false;
    waitSync.notifyAll();
      }
  } else if (evt instanceof EndOfMediaEvent) {
      p.setMediaTime(new Time(0));
      //p.start();
      //p.close();
      //System.exit(0);
  } else if (evt instanceof SizeChangeEvent) {
  }
View Full Code Here

      setSize(videoWidth + insetWidth,
        videoHeight + controlHeight + insetHeight);
      validate();
      mplayer.start();
  } else if (ce instanceof EndOfMediaEvent) {
      mplayer.setMediaTime(new Time(0));
      mplayer.start();
  }
    }
View Full Code Here

    {
      synchronized (QT_SYNC_OBJ)
        {
        if (qtSnapper.getDuration() <= 0 || qtSnapper.getTimeScale() <= 0)
          return Duration.DURATION_UNKNOWN;
        return new Time((qtSnapper.getDuration() * 1000000000L) / qtSnapper.getTimeScale());
        }
     
    }
View Full Code Here

        else if (m != null)
    {
      try
      {
        final double totalSeconds = (double) m.getDuration() / (double) m.getTimeScale();
        return new Time(totalSeconds);

      } catch (StdQTException e)
      {
        logger.log(Level.WARNING, "" + e, e);
        return DURATION_UNKNOWN;
View Full Code Here

          else if (m != null)
    {
      try
      {
        final double totalSeconds = (double) m.getTime() / (double) m.getTimeScale();
        return new Time(totalSeconds);

      } catch (StdQTException e)
      {
        logger.log(Level.WARNING, "" + e, e);
        return super.getMediaTime();
View Full Code Here


  // @Override
  public Time getPlayerStartLatency()
  {
    return new Time(0);
  }
View Full Code Here

TOP

Related Classes of javax.media.Time

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.