Hello,
I'm workin in a big project that includes video playing and a simple 3D render. I'm having troubles with the video reproduction using Movie class. At the time I set a OPENGL render in size() function I have sound but not image and the next error in the console "OpenGL error 1281 at bot endDraw(): invalid value". To make the thing simpler, next is a simplified version of my big project. There is no 3D render actually, however de OPENGL render is set in the setup():
Sketch:
import processing.video.*;
peli Peli;
Movie[] mv = new Movie[2];
int cnt = 0;
void setup() {
size(900, 900, OPENGL);
mv[0] = new Movie(this, "[HD] Grass Animation - Covered Next Tutorial!.mp4");
mv[1] = new Movie(this, "Grass Animation made in Blender 3D 2.58a HD.mp4");
Peli = new peli(mv);
}
void draw() {
if (mousePressed) {
Peli.play(0);
Peli.display(0);
Peli.pause(1);
//mv.play();
cnt++;
}
if((mousePressed==false)&&(cnt>=1)) {
Peli.play(1);
Peli.pause(0);
Peli.display(1);
}
}
void movieEvent(Movie m) {
m.read();
}
"peli" Class
class peli {
Movie[] mv;
peli(Movie[] mvTemp) {
mv = mvTemp;
//mv = new Movie(this,"[HD] Grass Animation - Covered Next Tutorial!.mp4");
}
void play(int index) {
mv[index].loop();
}
void display(int index) {
image(mv[index], 0, 0);
}
void pause(int index){
mv[index].pause();
}
}
Plesa help me with this. Sorry for the bad orthography
1