Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Question about display movie in Processing

$
0
0
Hi geeks!
I'm a newbie of Processing.
I want to make a movie "click-pause" & "click-play" function in Processing.
Here is a code that didn't work well.
Could anyone please help me to check out the problem.
Thanks a lot!

  1. int i;
  2. import processing.video.*;
  3. Movie myMovie;

  4. void setup() {
  5.  

  6. size(300, 200);
  7.   background(0);
  8.   myMovie = new Movie(this, "1.mp4");
  9.   myMovie.loop();
  10. }

  11. void movieEvent(Movie m) {
  12.   m.read();
  13. }

  14. void draw() {


  15.   background(255);
  16.   image(myMovie, 0, 0,300,200);

  17. if( i==0 ){
  18.   myMovie.pause();
  19. }
  20.  if(i==1){
  21.    myMovie.play();
  22.  }



  23. if (mousePressed == true) {
  24.  i=0;
  25.   i++;


  26.   if(i>1){
  27.     i=0;
  28.   }

  29. }
  30. }

Viewing all articles
Browse latest Browse all 1768

Trending Articles