Class JSMovieVideo

All Implemented Interfaces:
PropertyChangeListener, EventListener, Drawable, Interactive, Measurable, AsyncVideoI, DrawableImage, InteractiveImage, Trackable, Video

public class JSMovieVideo extends MovieVideo implements AsyncVideoI
This is a video that uses HTML5/JS to read mp4, mov, and other movie video formats. status: Only fleshed in; not implemented.
Author:
rhanson
  • Field Details

    • err

      public String err
    • progress

      protected int progress
    • mediaInfo

      protected Map<String,Object> mediaInfo
  • Method Details

    • getProperty

      public Object getProperty(String name)
      Description copied from class: VideoAdapter
      Gets a user property of the video. May return null.
      Specified by:
      getProperty in interface DrawableImage
      Overrides:
      getProperty in class VideoAdapter
      Parameters:
      name - the name of the property
      Returns:
      the value of the property
    • play

      public void play()
      Plays the video at the current rate. Overrides VideoAdapter method.
      Specified by:
      play in interface Video
    • stop

      public void stop()
      Stops the video.
      Specified by:
      stop in interface Video
    • getImage

      public BufferedImage getImage()
      Description copied from class: VideoAdapter
      Gets the current video image after applying enabled filters.
      Specified by:
      getImage in interface DrawableImage
      Overrides:
      getImage in class VideoAdapter
      Returns:
      the current video image with filters applied
    • setFrameNumber

      public void setFrameNumber(int n)
      Sets the frame number. Overrides VideoAdapter setFrameNumber method.
      Specified by:
      setFrameNumber in interface Video
      Overrides:
      setFrameNumber in class VideoAdapter
      Parameters:
      n - the desired frame number
      See Also:
    • setFrameNumberContinued

      public void setFrameNumberContinued(int n, double t)
    • getFrameCountDurationMS

      public double getFrameCountDurationMS()
      Description copied from interface: Video
      Gets the duration of the media, including a time for the last frame From XuggleVideo code, now also for JSMovieVideo
      
       // ....[0][1][2]...[startFrame][i]...[j][endFrame]...[frameCount-1]
       // ....|--------frameCountDurationMS--(nframes * aveDuration)-----|
       // ....^..^..^..^..^...........^..^..^..^.........^..^ startTimes[i]
       // ............................|--| frameDuration[i]
       // ..................................................|------------|
       // ..................................................frameDuration[frameCoumt-1]
       // ....|-------------video-specified rawDuration------------------|
       
      Specified by:
      getFrameCountDurationMS in interface Video
      Returns:
      the duration of the media in milliseconds or -1 if no video, or 100 if one frame
    • setRate

      public void setRate(double rate)
      Sets the relative play rate. Overrides VideoAdapter method.
      Specified by:
      setRate in interface Video
      Overrides:
      setRate in class VideoAdapter
      Parameters:
      rate - the relative play rate.
    • dispose

      public void dispose()
      Disposes of this video.
      Specified by:
      dispose in interface Video
      Overrides:
      dispose in class VideoAdapter
    • continuePlaying

      protected void continuePlaying()
      Plays the next time-appropriate frame at the current rate.
    • getTypeName

      public String getTypeName()
      Description copied from interface: Video
      Returns the VideoType name of this video.
      Specified by:
      getTypeName in interface Video
    • setFrameCount

      protected void setFrameCount(int n)
      Overrides:
      setFrameCount in class VideoAdapter
    • finalizeLoading

      protected void finalizeLoading()
      Specified by:
      finalizeLoading in class MovieVideo
    • cantRead

      public void cantRead()
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an XML.ObjectLoader to save and load JSMovieVideo data.
      Returns:
      the object loader
    • createThumbnailFile

      public static File createThumbnailFile(Dimension defaultThumbnailDimension, String sourcePath, String thumbPath)
    • getProgress

      public int getProgress()
      Specified by:
      getProgress in interface AsyncVideoI
    • getLoadedFrameCount

      public int getLoadedFrameCount()
      Specified by:
      getLoadedFrameCount in interface AsyncVideoI
    • seekMS

      protected boolean seekMS(double timeMS)
      Description copied from class: MovieVideo
      seek to a time in milliseconds.
      Specified by:
      seekMS in class MovieVideo
      Returns:
    • getImageForMSTimePoint

      protected BufferedImage getImageForMSTimePoint(double timeMS)
      Specified by:
      getImageForMSTimePoint in class MovieVideo
    • getPlatform

      protected String getPlatform()
      Description copied from class: MovieVideo
      Get this platform's name
      Specified by:
      getPlatform in class MovieVideo
      Returns:
      "Java" or navigator.userAgent