Loading...
Logo
Processing Forum
Greetings,

I have been trying to figure out how to work with multiple videos and create a user interface to launch them. I have gotten to this point, where the screen is blank except for a button. When this button is clicked, the video plays fine. I cannot figure out how to set up, say, six videos that could each be played by clicking on one of six buttons.

Here's my code for the single movie:

import codeanticode.gsvideo.*;

GSMovie movie;

void setup() {
  size(640, 480);
  background(0);
  // Load and play the video in a loop
  movie = new GSMovie(this, "drb02.mov");
  //movie.play();
}

void movieEvent(GSMovie movie) {
  movie.read();
}

void draw() {
  image(movie, 10, 10);
  fill(128);
  rect(20, 440, 60, 20);
}

void mousePressed() {
  if(mouseX > 20 && mouseX < 80 && mouseY > 440 && mouseY < 460) {
    println("got a hit!");
    movie.stop();
    movie.play();
  }
}

Any help greatly appreciated.

Thanks,

George

MacBook Pro 15" 2.4GHz Intel Core i5, QuickTime v.10.0
Processing v. 1.2.1