make a video background which works when a button stays pressed??

edited January 2016 in Library Questions

Hi everybody,

i write you from France so sorry for my english.

Because i want make my portfolios, I try to get a background video which play when the button"space" stays pressed. For few days i have read a lot of articles to find any solutions. Can you try to explain me how can i start this code?

Thanks you so much, this post is my last chance.

Camille :)

Answers

  • edited January 2016

    Try something like that maybe?

    import processing.video.*;
    Movie myMovie;
    
    void setup() {
      size(200, 200);
      myMovie = new Movie(this, "yourMovie.mov");
     }
    
    void draw() {
      tint(255, 20);
      if (mousePressed){
        myMovie.loop();
        } else {
        myMovie.noLoop();
      }
      image(myMovie, 0, 0);
    }
    
    void movieEvent(Movie m) {
      m.read();
    }
    
  • Thanks you Ater! I will try that RIGHT NOW :D

  • Did it work? Actually, as you asked for background, you can use background(myMovie);, instead of image(myMovie, 0, 0);.

Sign In or Register to comment.