I am having problems with videos.
I am trying to play several videos by name.
Just play one movie at one time and the play the first movie after finished the final movie.
I modified dirListExample code for videos.
This is my testApp.cpp code.
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
DIR.setVerbose(false);
nVideos = DIR.listDir("movies");
videos = new ofVideoPlayer[nVideos];
for(int i = 0; i < nVideos; i++){
videos[i].loadMovie(DIR.getPath(i));
videos[i].play();
}
currentVideo = 0;
ofBackground(255,255,255);
}
//--------------------------------------------------------------
void testApp::update(){
videos[currentVideo].idleMovie();
if(videos[currentVideo].getIsMovieDone()){
if (currentVideo == nVideos){
currentVideo = 0;
}else{
currentVideo++;
}
}
}
//--------------------------------------------------------------
void testApp::draw(){
videos[currentVideo].setLoopState(OF_LOOP_NONE);
if (nVideos > 0){
ofSetColor(0xffffff);
ofSetColor(0x999999);
videos[currentVideo].draw(0,0);
}
}
It works, but after finished playing final movie, it doesnt go back to the first movie.
Someone can help me?