Video not showing

Hi ofPeople
I’m trying to make a small program that can play one of 2 videos. So far i can choose which video to play with the number buttons on my keyboard, and make it play, stop and close.
However, it only plays the sound from the video, and not the picture. I have created a method to handle each video, and then I call the required method when I want to play a movie.
My code looks like this:

#include “testApp.h”

//--------------------------------------------------------------
void testApp::setup(){
//ofBackground(0, 0, 0);

video1.loadMovie(“1.mov”);
video2.loadMovie(“2.mov”);

play = false;

}

//--------------------------------------------------------------
void testApp::update(){
video1.idleMovie();
video2.idleMovie();

if (video1.getIsMovieDone()) {
play = false;
video1.closeMovie();
}

if (video2.getIsMovieDone()) {
play = false;
video2.closeMovie();
}
}

//--------------------------------------------------------------
void testApp::draw(){

}

//--------------------------------------------------------------
void testApp::keyPressed(int key){
key = key-48;

switch (key) {
case 1:
if (!play) {
et();
}
break;
case 2:
if (!play) {
to();
}
break;
default:
break;
}

key = 0;

}

//--------------------------------------------------------------
void testApp::et(){
play = true;
video1.loadMovie(“1.mov”);
video1.draw(0, 0);
video1.play();
video1.setLoopState(OF_LOOP_NONE);

}

//--------------------------------------------------------------
void testApp::to(){
play = true;
video2.loadMovie(“2.mov”);
video2.draw(0, 0);
video2.play();
video2.setLoopState(OF_LOOP_NONE);

}

As I said, everything works fine, except the images of the video are not drawn. Is this a bug or am I just a newbie who can’t see the obvious problem?

Thanks.

/Morten

your draw() functions are only called in to() and et() and those are only called when keys are pressed. you should be drawing on every frame, so either in update() or draw().

nemik: Perfect, thanks. Now it works.