I want pass to next step when the video stop

Hi, i´m beginner writing code, and I can´t resolve somthing.
When the video stop, i want it to pass to other step. I know that “if (movie1.stop()){step = 10;}” doesn´t exist, but i don´t know how to write it right.
Any help would be appreciated!!

void laberinto() {
if (verVideo == 1) {
image(movie1, 0, 0);
} else if (verVideo == 2) {
image(movie2, 0, 0);
} else if (verVideo == 3) {
image(movie3, 0, 0);
} else if (verVideo == 4) {
image(movie4, 0, 0);
} else if (verVideo == 5) {
image(movie5, 0, 0);
} else if (verVideo == 6) {
image(movie6, 0, 0);
} else if (verVideo == 7) {
image(movie7, 0, 0);
}

}

void EligirVideoAlAzar() {
verVideo = int(random(7))+1;
println(verVideo);

if (verVideo == 1) {
movie1.play();
} else if (verVideo == 2) {
movie2.play();
} else if (verVideo == 3) {
movie3.play();
} else if (verVideo == 4) {
movie4.play();
} else if (verVideo == 5) {
movie5.play();
} else if (verVideo == 6) {
movie6.play();
} else if (verVideo == 7) {
movie7.play();
}
if (verVideo== 1 && movie1.time()>=movie1.duration()) {
fill(255);
textSize(25);
text(“Tecla A para volver a empezar”, 200, 240);
}
if (verVideo== 2 && movie2.time()>=movie2.duration()) {
fill(255);
textSize(25);
text(“Tecla A para volver a empezar”, 200, 240);
}
if (verVideo== 3 && movie3.time()>=movie3.duration()) {
fill(255);
textSize(25);
text(“Tecla A para volver a empezar”, 200, 240);
}
if (verVideo== 4 && movie4.time()>=movie4.duration()) {
fill(255);
textSize(25);
text(“Tecla A para volver a empezar”, 200, 240);
}
if (verVideo== 5 && movie5.time()>=movie5.duration()) {
fill(255);
textSize(25);
text(“Tecla A para volver a empezar”, 200, 240);
}
if (verVideo== 6 && movie6.time()>=movie6.duration()) {
fill(255);
textSize(25);
text(“Tecla A para volver a empezar”, 200, 240);
}
if (verVideo== 7 && movie7.time()>=movie7.duration()) {
fill(255);
textSize(25);
text(“Tecla A para volver a empezar”, 200, 240);
}
}

Hi! Welcome to the forums.

Please read the guide on posting. Your question needs more work and clarification for someone to start helping you

Please check this post about playing multiple videos and if this helps. If further questions, prepare a short code demonstrating your attempt. This allows to reproduce your challenge and see your current approach.

Kf

1 Like