import processing.video.*;
Movie movNor, movTrg;
float loopPos = 0.2;
String movFile1 = "6162.mov";
String movFile2 = "5824.mov";
int scrW, scrH, scrW2, scrH2;
int chk = 0;
int cnt = 1;
int cnt2 = 0;
void setup() {
size(1280, 720+360);
scrW = width;
scrH = (int)(width *9/16);
scrW2 = (int)(scrW /2);
scrH2 = (int)(scrH /2);
movInit();
movNor.play();
movTrg.pause();
}
void draw() {
if(chk == 1) {
image(movTrg, 0, 0, scrW, scrH);
image(movNor, 0, scrH, scrW2, scrH2);
image(movTrg, scrW2, scrH, scrW2, scrH2);
} else {
image(movNor, 0, 0, scrW, scrH);
image(movNor, 0, scrH, scrW2, scrH2);
image(movTrg, scrW2, scrH, scrW2, scrH2);
}
if(movNor.duration() - movNor.time() < loopPos) {
movNor.jump(0);
cnt++;
}
text(cnt, 20, scrH +30);
text(cnt2, scrW2 +20, scrH +30);
}
void movieEvent(Movie m) {
m.read();
}
void movInit() {
movNor = new Movie(this, movFile1);
movTrg = new Movie(this, movFile2);
}
void mousePressed() {
chk = 1;
cnt2++;
movTrg.jump(0);
movTrg.play();
}
void mouseReleased() {
chk = 0;
movTrg.pause();
movTrg.jump(0);
}