Skip to content

Instantly share code, notes, and snippets.

@atduskgreg
Created November 12, 2015 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atduskgreg/26254532ab79b973955a to your computer and use it in GitHub Desktop.
Save atduskgreg/26254532ab79b973955a to your computer and use it in GitHub Desktop.
import processing.video.*;
Movie video;
boolean videoLoaded = false;
void setup(){
size(512, 640);
selectInput("Select a video to play", "fileSelected");
}
void fileSelected(File selection) {
if (selection == null) {
println("Window was closed or the user hit cancel.");
} else {
println("User selected " + selection.getAbsolutePath());
video = new Movie(this, "/" + selection.getAbsolutePath());
videoLoaded = true;
video.play();
println(video.width + "x" + video.height);
}
}
void draw(){
if(videoLoaded){
image(video, 0, 0);
}
}
void movieEvent(Movie m) {
m.read();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment