We are about to switch to a new forum software. Until then we have removed the registration on this forum.
import processing.video.*;
import processing.serial.*;
Serial myPort;
int[] valr={1021,1021,1021,1021,1021,1021,1021,1021,1021};
Movie[] endmovie = new Movie[9];
void setup(){
fullScreen();
for(int i = 0;i<9;i++){
endmovie[i] = new Movie(this,"b"+i+".mp4");
}
myPort = new Serial(this,Serial.list()[0], 9600);
myPort.bufferUntil('\n'); //buffer until meet '\n', then call the event listener
}
void draw(){
image(endmovie[0],0,0,width/3,height/3);
image(endmovie[1],width/3,0,width/3,height/3);
image(endmovie[2],width*2/3,0,width/3,height/3);
image(endmovie[3],0,height/3,width/3,height/3);
image(endmovie[4],width/3,height/3,width/3,height/3);
image(endmovie[5],width*2/3,height/3,width/3,height/3);
image(endmovie[6],0,height*2/3,width/3,height/3);
image(endmovie[7],width/3,height*2/3,width/3,height/3);
image(endmovie[8],width*2/3,height*2/3,width/3,height/3);
for(int i = 0;i<9;i++){
endmovie[i].play();
if(valr[i]>500){
endmovie[i].speed(1.0);
}else{
endmovie[i].speed(-1.0);
}
}
}
void movieEvent(Movie m){
m.read();
}
void serialEvent(Serial p) {
String inString = p.readString();
print(inString);
if(inString!=null){
String[] rec= split(inString, ',');
for(int i=0;i<9;i++){
valr[i]=int(rec[i]);
}
}
}
Answers
when I run my program in processing, it works fine, but when I export it, it won't launch Although some basic example from processing works fine when exported, but mine won't launch.my computer system is window10.my processsing vision is 3.3.5.here is codes.
Check that the exported app contains the two libraries you import at the top there.
And all the necessary movie files.
i found this in application.window64/lib. i guess it already included video and serial library.
movie files were in data