Here is my code, the scenario is opened from Arduino button. One button plays 1 and the other 2. The buttons and the printing work good. The screen opens, audio plays but the movie/frames don’t.
import processing.serial.*;
import processing.video.*;
Serial port;
PImage img1, img2;
Movie movie1, movie2;
void setup(){
fullScreen();
background(0);
printArray(Serial.list()); //print alle serial poorten
port = new Serial(this, "/dev/cu.SLAB_USBtoUART", 9600);
img1 = loadImage("IMG_3147.jpg");
img2 = loadImage("IMG_2395.JPG");
newStart();
}
void movies(){
movie1 = new Movie(this, "IMG_0585.mp4");
movie1.loop();
movie2 = new Movie(this, "IMG_0574.mp4");
movie2.loop();
}
void movieEvent(Movie m) {
m.read();
}
void newStart(){
background(0);
}
void draw(){
int scenario = port.read();
println(scenario);
if (scenario == 2) {
movies();
movie1.play();
if (movie1.available()) {
movie1.read();
}
image(movie1, 0, 0, width, height);
}
if (scenario == 1) {
movies();
movie2.play();
if (movie2.available()) {
movie2.read();
}
image(movie2, 0, 0, width, height);
}
if (scenario == -1){
int lachen = 3;
println(lachen);
delay(100);
}
}