video playlist
in
Core Library Questions
•
3 years ago
Hi everyone,
I'm pretty new to processing. i am trying to work with video right now for my school project and i had a question to ask.
I was wondering if i could have a set of short video clips ( say 20 in all ), out of which i could choose any three and make them play in the sequence of my selection ( like maybe each key triggers a video clip ). Somewhat like a play list, where i can cue those three clips before playing.
So far my progress has been to make those clips play in a sequence, but i couldn't figure out how to do the choosing bit of it.
Thank you all.
I'm pretty new to processing. i am trying to work with video right now for my school project and i had a question to ask.
I was wondering if i could have a set of short video clips ( say 20 in all ), out of which i could choose any three and make them play in the sequence of my selection ( like maybe each key triggers a video clip ). Somewhat like a play list, where i can cue those three clips before playing.
So far my progress has been to make those clips play in a sequence, but i couldn't figure out how to do the choosing bit of it.
- import processing.video.*;
int maxMovies = 20; // Total number of movies
int myMoviesIndex = 0; // Initial movie to be displayed
Movie[] myMovies;
void setup() {
size(720,480, P2D);
myMovies = new Movie[maxMovies]; //array of movies
for (int i = 0; i < myMovies.length; i ++ ) {
println(i);
myMovies[i] = new Movie(this, i+1 + ".mov");
myMovies[i].loop();
myMovies[i].pause();
}
}
void draw() {
myMovies[myMoviesIndex].play();
image(myMovies[myMoviesIndex],0,0); // Displays image
println(myMovies[myMoviesIndex].time());
float mt = myMovies[myMoviesIndex].time();
float md = myMovies[myMoviesIndex].duration();
if(mt == md) {
myMovies[myMoviesIndex].pause();
myMoviesIndex ++;
if (myMoviesIndex == maxMovies) {
myMoviesIndex = 0;
}
myMovies[myMoviesIndex].jump(0);
myMovies[myMoviesIndex].play();
}
}
void movieEvent(Movie myMovies) {
myMovies.read();
}
Thank you all.
3