keypressed
in
Core Library Questions
•
11 months ago
import processing.video.*;
Movie myMovie, yourMovie;
boolean isPlaying;
boolean[] movieState;
void setup() {
background(0);
size(800, 800);
myMovie = new Movie(this, "1.mov");
yourMovie = new Movie(this, "2.mov");
}
void draw(){
image(myMovie, 100, 200);
image(yourMovie,100,200);
}
void movieEvent(Movie myMovie) {
myMovie.read();
yourMovie.read();
}
void keyPressed() {
if (key == 'p') {
if (isPlaying) {
myMovie.play();
}
isPlaying = !isPlaying;
}
}
void keyReleased(){
if(key=='p'){
if (isPlaying){
myMovie.stop();
yourMovie.play();
}
isPlaying = !isPlaying;
}
}
When I released the 'P' the first movie stops and second movie comes out but only the sound is playing and the screen is just black. Is there a way I can fix this to make second movie to appear on the screen.
1