Toggling between two videos in array with GLvideo

edited October 2017 in Raspberry PI

need a bit of help with this code. I'm trying to adapt a sketch I made originally for my laptop with the video library. It's pretty simple, I'm reading the values 1 and 0 from the serial port and switching between two synched clips each time there's a change. I'm not having such successful results trying to recreate this with GLVideo however, which I've never used before. hopefully I can fairly easily achieve what I want?

thanks for any help you might have

 import processing.serial.*;
 Serial myPort;
 int val=0;
 import gohai.glvideo.*;
 GLMovie[]video = new GLMovie [2];
 int i =0;

 void setup() {
   String portName = Serial.list()[0];
   myPort= new Serial (this, portName,115200);
   video [0] = new GLMovie(this, "low.mp4");
   video [1] = new GLMovie (this, "high.mp4");
   video [i].loop(); 

 void draw() {
  if (video[i].available()) {
   void serialEvent(Serial p) {
     if (myPort.available()>0) {;
 if (val==0) {
 else {


Sign In or Register to comment.