Video stuck problem


I am having problems with videos when I try to use different classes to read videos than testApp. I use a vector in a separate class called “ClipList” and I instantiate it this way:

ClipList::ClipList(int nb){
numberClips = nb;
for(int i = 0;i<nb;i++){
ofVideoPlayer video;

and then I simply load the movies the normal way:

void ClipList::loadClips(){“movies/wide-shot.m4v”);“movies/chords-hand.m4v”);“movies/pickin-hand.m4v”);“movies/TV-edit.m4v”);
for(int i = 1;i<4;i++){;
for(int i = 0;i<4;i++){;

Unluckily, though there is no error in compilation, the program just get stuck here “class ofBaseDraws” and just never stops. I need to kill it then, as the window doesn’t show up. The App.cpp is quiet similar to the moviePlayerExample excepts that instead of loading and playing the movies, it calls my class ClipList.

I have tried hundreds of variables with arrays and such and it always got stuck here at some point. Can someone help me?

What you want to do is either create all the ofVideoPlayers as properties of the class in the class declaration, i.e.

class testApp : public ofBaseApp {  
 ofVideoPlayer p1;  
 // ...etc bunch of videos  
 vector<ofVideoPlayer> clips;  

and then push those into the vector OR make the vector a vector of pointers to movie players and then allocate them with the new keyword:

vector<ofVideoPlayer*> clips;  

and then

ofVideoPlayer* p = new ofVideoPlayer();  
// later on...>loadMovie("movies/wide-shot.m4v");  

Hope that helps