I am working in Processing, using java. I'm trying to create a cctv type footage experience, where the viewer sees different camera footage flicked through based off of the amount of time that had passed since the program ran.
Currently, the first video plays perfectly fine. But then once that one stops, for some reason the second video never displays.
void draw(){
int timer = getAgeInSeconds();
if(timer <= 20){ // RESPONSIBLE FOR SWITCHING OUT MOVIES
if(movie1.available()){ // Refreshes frame. Can mofify with FrameRate()
//frameRate();
movie1.read();
image(movie1,0,0, width, height);
}
}
if(timer >= 21){
if(movie2.available()){
movie2.read();
image(movie2,0,0,width,height);
}
}
}
public int getAgeInSeconds(){ //FUNCTION FOR CALCULATING SECONDS FROM RUN TIME INSTEAD OF COMPUTER CLOCK
long nowMillis = System.currentTimeMillis();
int timer = (int)((nowMillis - this.createdMillis) /1000);
print("\n" + timer);
return(timer);
}