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

Problem with toggling between multiple videos on processing 2.2.1

$
0
0

hi,
so im quite a noob, just clearing that.
im working on a project which involves switching between multiple videos on processing when i press a key. im trying to do some initial testing right now, and trying to get processing to switch between two videos on keypress. the video switches alright, but i cant see it in the applet window! the previous video ( in the paused state continues to stay on top ) . how do i fix this?? please help. find the code below -

    import processing.video.*;

    Movie theMov;
    Movie theMov2;



    void setup() {
      size(1440, 900);
      theMov = new Movie(this, "sin_city.mp4");
      theMov2 = new Movie(this, "blue_velvet.mp4");

      theMov.stop();
      theMov2.stop();
    }

    void draw() {
      background (0);
      image(theMov, 0, 0);
      image(theMov2, 0, 0);
    }

    void movieEvent(Movie m) {
      m.read();
    }

    void keyPressed(){
      if (key == 'p'){

            theMov2.pause();
            background(0);
            theMov.play();

              } else if (key == 'o'){

                       theMov.pause();
                       background(0);
                       theMov2.play();

                     }


}

Viewing all articles
Browse latest Browse all 2896

Trending Articles