@pjs preload="1.mp4", "2.mp4", "3.mp4", "4.mp4", "coffin1.jpg", "coffin2.jpg", "coffin3.jpg", "coffin4.jpg", "coffin5.jpg", "coffin6.jpg", "coffin7.jpg", "coffin8.jpg", "coffin9.jpg", "coffin10.jpg", "coffin11.jpg", "coffin12.jpg", "coffin13.jpg", "coffin14.jpg", "coffin15.jpg", "coffin16.jpg", "coffin17.jpg", "coffin18.jpg", "coffin19.jpg", "coffin20.jpg", "coffin21.jpg", "coffin22.jpg", "coffin23.jpg", "coffin24.jpg", "coffin25.jpg", "coffin26.jpg", "coffin27.jpg", "coffin28.jpg", "coffin29.jpg", "coffin30.jpg", "coffin31.jpg", "coffin32.jpg", "coffin33.jpg", "coffin34.jpg", "coffin35.jpg";
PImage[] myImageArray = new PImage[35];
import processing.video.*;
String[]vid = {"1.mp4", "2.mp4", "3.mp4", "4.mp4",};
Movie myMovie;
boolean playMovie=true;
void setup() {
fullScreen();
background(255);
myImageArray[0] = loadImage("coffin1.jpg");
myImageArray[1] = loadImage("coffin2.jpg");
myImageArray[2] = loadImage("coffin3.jpg");
myImageArray[3] = loadImage("coffin4.jpg");
myImageArray[4] = loadImage("coffin5.jpg");
myImageArray[5] = loadImage("coffin6.jpg");
myImageArray[6] = loadImage("coffin7.jpg");
myImageArray[7] = loadImage("coffin8.jpg");
myImageArray[8] = loadImage("coffin9.jpg");
myImageArray[9] = loadImage("coffin10.jpg");
myImageArray[10] = loadImage("coffin11.jpg");
myImageArray[11] = loadImage("coffin12.jpg");
myImageArray[12] = loadImage("coffin13.jpg");
myImageArray[13] = loadImage("coffin14.jpg");
myImageArray[14] = loadImage("coffin15.jpg");
myImageArray[15] = loadImage("coffin16.jpg");
myImageArray[16] = loadImage("coffin17.jpg");
myImageArray[17] = loadImage("coffin18.jpg");
myImageArray[18] = loadImage("coffin19.jpg");
myImageArray[19] = loadImage("coffin20.jpg");
myImageArray[20] = loadImage("coffin21.jpg");
myImageArray[21] = loadImage("coffin22.jpg");
myImageArray[22] = loadImage("coffin23.jpg");
myImageArray[23] = loadImage("coffin24.jpg");
myImageArray[24] = loadImage("coffin25.jpg");
myImageArray[25] = loadImage("coffin26.jpg");
myImageArray[26] = loadImage("coffin27.jpg");
myImageArray[27] = loadImage("coffin28.jpg");
myImageArray[28] = loadImage("coffin29.jpg");
myImageArray[29] = loadImage("coffin30.jpg");
myImageArray[30] = loadImage("coffin31.jpg");
myImageArray[31] = loadImage("coffin32.jpg");
myImageArray[32] = loadImage("coffin33.jpg");
myImageArray[33] = loadImage("coffin34.jpg");
myImageArray[34] = loadImage("coffin35.jpg");
frameRate(5);
//
myMovie = new Movie(this, vid[int(random(0,4))]);
myMovie.play();
}
void draw() {
frameRate(2);
imageMode(CENTER);
image(myImageArray[(int)random(myImageArray.length)], 1200,700,1920,1080);
if(playMovie==true){
myMovie.play();
frameRate(30);
image(myMovie, 1200, 700,1920,1080 );
if(myMovie.time()>=myMovie.duration()){
myMovie.stop();
playMovie=false;
}
}
}
void movieEvent(Movie m) {
m.read();
}
void mousePressed() {
myMovie = new Movie(this, vid[int(random(0,3))]);
myMovie.play();
playMovie=true;
}