うまく巻き戻しのとこは消えないね
そもそもこのやり方ってビデオの再生が飛んだりProcessingが死んだりしない?
import processing.video.*;
Movie[] mov = new Movie[2];
int index, nextIndex;
float currentTime, changeTime;
void setup() {
size(640, 480, P2D); frameRate(15); background(0);
mov[0]=new Movie(this, "1.mov");
mov[1]=new Movie(this, "2.mov");
index = nextIndex = 0; changeTime = -1;
mov[0].loop();
}
void draw() {
image(mov[index], 0, 0, mov[index].width, mov[index].height);
currentTime = mov[index].time();
if (currentTime < changeTime && currentTime > 0.07) {
changeTime = -1;
mov[index].stop(); index = nextIndex; mov[index].loop();
}
}
void keyPressed() {
changeTime = mov[index].time();
noLoop(); mov[index].jump(0); redraw();
switch (key) {
case '1':
nextIndex = 0; break;
case '2':
nextIndex = 1; break;
}
loop();
}