I'm trying to get this code fixed to choose a random video from an array and then jump two a moment in that video every two seconds, it chooses and jumps perfectly but it does not play the video it just shows a still. I can's seem to find what's wrong.
import processing.video.*;
Movie[] mov = new Movie[2];
int rndm01 = 1;
float rndmov = 1;
int lastTimeCheck;
int timeIntervalFlag = 2000;
void setup() {
size(displayWidth, displayHeight);
frameRate(30);
// Load and play the video in a loop
mov[0] = new Movie(this, "testvid01.mov");
mov[1] = new Movie(this, "testvid02.mov");
mov[0].loop();
mov[1].loop();
lastTimeCheck = millis();
}
void movieEvent(Movie m) {
m.read();
}
void draw() {
if ( millis() > lastTimeCheck + timeIntervalFlag ) {
lastTimeCheck = millis();
rndm01 = (int(random(0, 2)));
rndmov = random(mov[rndm01].duration());
image(mov[rndm01], 0, 0, width, height);
mov[rndm01].jump(rndmov);
}
}
I someone knows what I'm doing wrong, some help is vert much apreciated.