We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Im trying to have a code where the user clicks and the video plays; then after the video is done, the user clicks again and so on and so on. My problem is how do I do this? I have the videos but they play on top of each other and the first video never goes away. Heres the code
PImage img1;
//movie var, name after actual movie! Movie wtch1; Movie wtch2; Movie wtch3; Movie wtch4; Movie wtch5;
//The var to control what movie plays next(hopefull)---------------------------------Movie var float mvar = 1;
void setup () { size (1152, 864);
//starting image img1 = loadImage("Send.png");
//video stuff-----------------------------------------------------------------setup video wtch1 = new Movie(this, "wtch1.mov"); wtch2 = new Movie(this, "wtch2.mov"); wtch3 = new Movie(this, "wtch3.mov"); wtch4 = new Movie(this, "wtch4.mov"); wtch5 = new Movie(this, "wtch5.mov"); //
// }
void draw () { background(0); //-----------------------------------------------------------------------Starting image tint(255, 255); image(img1, 0, 0, width, height);
image(wtch1, 0, 0, width, height);//////-------------------------------------wtch1 AND if AND mvar if(mousePressed){ wtch1.play();
if(mousePressed && mvar == 2){ image(wtch2, 0, 0, width, height); wtch2.play(); mvar = 3; }
}
void movieEvent (Movie m) { //---------------------------------------------------Movie m| m.read m.read(); }
Answers
Please format your code. Edit your post (gear on top right side of any of your posts), select your code and hit ctrl+o. Leave an empty line above and below your block of code. Details here: https://forum.processing.org/two/discussion/15473/readme-how-to-format-code-and-text
Then check:
https://forum.processing.org/two/discussion/22991/issue-with-video-player#latest
https://forum.processing.org/two/discussion/23419/video-play-random-video-sequence#latest
https://forum.processing.org/two/discussion/comment/85389/#Comment_85389
https://forum.processing.org/two/discussion/8109/prepare-a-second-video-to-play-without-slowing-down-the-first-video#latest
Kf