Created
November 12, 2015 19:32
-
-
Save atduskgreg/26254532ab79b973955a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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