Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

load multiple videos in openProcessing

$
0
0

I would like to make a program in OpenProcessing that can allow me to play a video, stop the video, then load an image, , and click with the mouse, either on the left or right of the screen and this causes the load of another video and repeats the action a second time.

The problem that I'm not able to put several videos on line through the program without them interfering with each other and have all the requested actions in the order.

my code:

import processing.video.Movie;

static final int QTY = 5;
final Movie[] movies = new Movie[QTY];
 int idx;
 PImage img;

  void setup() {
 size(1440, 900);

  movies[0] = new Movie(this, "1-2.mp4");
  movies[1] = new Movie(this, "3.mp4");
  movies[2] = new Movie(this, "4.mp4");
  movies[3] = new Movie(this, "5.mp4");
  movies[4] = new Movie(this, "6.mp4");

  img0 = loadImage("CHOIX.jpg");
  img1 = loadImage ("GAGNE.png");
  img2 = loadImage ("PERDU.png");
             }

   void draw() {
   background(0);
    set(0,0,movies[idx] );

    movies[0] = new Movie(this, "1.mp4");
    movies[0].stop();

    img0 = loadImage("CHOIX.jpg");

    clear();
    posX = mouseX;
    if(posX>windowWidth/2){
   movies[1] = new Movie(this, "2.mp4");
   movies[1].stop();
     else {
    movies[2] = new Movie(this, "3.mp4");
    movies[2].stop();
        }
            }

     img0 = loadImage("CHOIX.jpg");

     clear();
     posX = mouseX;
     if(posX>windowWidth/2){
     movies[3] = new Movie(this, "4.mp4");
     movies[3].stop();
     else {
     movies[4] = new Movie(this, "5.mp4");
     movies[4].stop();
       }

          }
             }

Viewing all articles
Browse latest Browse all 2896

Trending Articles