We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi All, i would be able to stream two video on two different monitor, at the same time. So far this is the code i written to stream one on the secondary monitor, but is not working:
import processing.video.*;
final PApplet projector0 = new ProjectorSketch();
final PApplet projector1 = new ProjectorSketch();
void setup() {
size(300, 300, JAVA2D);
smooth(4);
noLoop();
stroke(-1);
runSketch(new String[] { "--display=1", "--present", "--sketch-path=" + sketchPath(), "Projector" }, projector0);
}
void draw() {
background(0);
}
class ProjectorSketch extends PApplet {
Movie movie;
void setup() {
stroke(#FFFF00);
movie = new Movie(this, "transit.mov");
movie.loop();
}
public void settings() {
size(displayWidth, displayHeight, JAVA2D);
}
void draw() {
image(movie, 0, 0, width, height);
}
}
public void movieEvent(Movie m) {
m.read();
}
Answers
No back ticks, instead edit your post (gear on top right side of any of your posts), select your code and hit
ctrl+o
. Leave an empty line above and below your block of code. Details here: https://forum.processing.org/two/discussion/15473/readme-how-to-format-code-and-textKf
Done, any tips now?
Your subclass ProjectorSketch doesn't seem to have its own movieEvent(). :-?
Try this. It works in my machine: Win 10. If you set the display to zero, it takes both screens. If you set it to 1, it loads in one screen. If 2 is selected, it is loaded in the other screen.
Kf
Keyword: kf_keyword mainSketch, runSketch, multiple windows, multiple PApplets, main function