import processing.video.*; //Importing video library Movie mov1, mov2, mov3, mov4, mov5, mov6, mov7, mov8, mov9; // 9 Movie objects are created void setup() { size(480, 360, P2D); //size of the screen and render type have been determined, for different render types check processing reference //load movies into the movie objects created above. To change the movie, just replace the path of the movie you want to play in between " " mov1 = new Movie(this, "station.mov"); mov2 = new Movie(this, "station.mov"); mov3 = new Movie(this, "station.mov"); mov4 = new Movie(this, "station.mov"); mov5 = new Movie(this, "station.mov"); mov6 = new Movie(this, "station.mov"); mov7 = new Movie(this, "station.mov"); mov8 = new Movie(this, "station.mov"); mov9 = new Movie(this, "station.mov"); } void draw() { //place movies on screen according to the grid specifications image(mov1, 0, 0); image(mov2, 160, 0); image(mov3, 320, 0); image(mov4, 0, 120); image(mov5, 160, 120); image(mov6, 320, 120); image(mov7, 0, 240); image(mov8, 160, 240); image(mov9, 320, 240); // play all movies in loop mov1.loop(); mov2.loop(); mov3.loop(); mov4.loop(); mov5.loop(); mov6.loop(); mov7.loop(); mov8.loop(); mov9.loop(); //following code is a simple if-else control structure. if a specified key is being kept pressed, movie tied to that key is paused. if(keyPressed && key == '7') mov1.pause(); else if(keyPressed && key == '8') mov2.pause(); else if(keyPressed && key == '9') mov3.pause(); else if(keyPressed && key =='4') mov4.pause(); else if(keyPressed && key =='5') mov5.pause(); else if(keyPressed && key =='6') mov6.pause(); else if(keyPressed && key =='1') mov7.pause(); else if(keyPressed && key =='2') mov8.pause(); else if(keyPressed && key =='3') //movie.pause() command does not actually pause the movie, it freezes the current frame but movie keeps playing in backround. //if you want to actually pause the movie you should decrease the speed to zero by movie.speed(). then set its speed again to one to play it. //this code piece demonstrates that in comparison to movie.play(). mov9.speed(0); if(keyPressed && key =='j') mov9.speed(1); }