We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
jump between two video files forever (Read 462 times)
jump between two video files forever
Jan 8th, 2006, 10:53pm
 
hi, i am trying to load "station.mov" - when it is finished then load "kitti.mov", when "kitti.mov" is finished, then load "station.mov" and loop like that forever.

this is the code i used, but it's bad. i really appreciate if anyone help me to make it work okay?

Code:

import processing.video.*;
Movie myMovie, yourMovie;
float nextMovie=0;

void setup()
{
size(200, 200);
background(0);
// Load and play the video in a loop
myMovie = new Movie(this, "station.mov");
myMovie.play();
yourMovie = new Movie(this, "kitti.mov");
//yourMovie.jump(0);
//yourMovie.stop();

}

void movieEvent(Movie m) {
if(m == myMovie) {
myMovie.read();
} else if(m == yourMovie) {
yourMovie.read();
}
}


void draw()
{
image(myMovie, 0, 0,200,100);
image(yourMovie, 0, 100,200,100);
switchNext();
}

void switchNext() {
print("myMovie "+int(myMovie.time())+"of"+int(myMovie.duration())+" yourMovie "+int(yourMovie.time())+"of"+int(yourMovie.duration())+"\n");
if (myMovie.time()==myMovie.duration()){
myMovie.jump(0);
myMovie.stop();
yourMovie.jump(0);
yourMovie.play();
}/* else if (yourMovie.time()==yourMovie.duration()){
yourMovie.jump(0);
yourMovie.stop();
myMovie.jump(0);
myMovie.play();
}*/

}
Page Index Toggle Pages: 1