Class Name

Movie

Description

Datatype for storing and playing movies. Movies must be located in the sketch's data folder or an accessible place on the network to load without an error.

Examples

  • import processing.video.*;
    Movie myMovie;
    
    void setup() {
      size(200, 200);
      myMovie = new Movie(this, "totoro.mov");
      myMovie.loop();
    }
    
    void draw() {
      tint(255, 20);
      image(myMovie, mouseX, mouseY);
    }
    
    // Called every time a new frame is available to read
    void movieEvent(Movie m) {
      m.read();
    }
    
    

Constructors

  • Movie(parent, filename)

Parameters

  • parentPApplet
  • filenameString

Methods

  • frameRate()Sets how often frames are read from the movie.
  • speed()Sets the relative playback speed of the movie.
  • duration()Returns the length of the movie in seconds.
  • time()Returns the location of the playback head in seconds.
  • jump()Jumps to a specific location within a movie.
  • available()Returns "true" when a new movie frame is available to read.
  • play()Plays a movie one time and stops at the last frame.
  • loop()Plays a movie continuously, restarting it when it's over.
  • noLoop()If a movie is looping, this will cause it to play until the end and then stop on the last frame.
  • pause()Pauses a movie during playback.
  • stop()Stops a movie from continuing.
  • read()Reads the current frame of the movie.