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!
- int i;
- import processing.video.*;
- Movie myMovie;
- void setup() {
- size(300, 200);
- background(0);
- myMovie = new Movie(this, "1.mp4");
- myMovie.loop();
- }
- void movieEvent(Movie m) {
- m.read();
- }
- void draw() {
- background(255);
- image(myMovie, 0, 0,300,200);
- if( i==0 ){
- myMovie.pause();
- }
- if(i==1){
- myMovie.play();
- }
- if (mousePressed == true) {
- i=0;
- i++;
- if(i>1){
- i=0;
- }
- }
- }