Simple video player

Hi there, i am really begginner and starting how to figure the essence of openframeworks. Please don’t blame so much if i have used badly the seach engine, also sorry if i can’t explain correctly in english because i don’t use it as a primary language…

So in the effort of understanding the declarations i amb looking at the examples and some other experiments that i see too complex… And i just wanted to know (and see) how a simple video player would be created in openframeworks.
Let’s say it takes a video file (mp4 for the example, if it matters) and it plays it widowed, then if the user wants it fullscreen, press “f” (or any other) and voilá.

Just that simple program for me to figure “where goes what” and i can start analizing orders.

Thanks in advance.

take a look at the moviePlayerExample, it does that more or less.

I have looked at it alredy.

Thanks for the reply.

  
  
#include "testApp.h"  
  
ofVideoPlayer player;  
//--------------------------------------------------------------  
void testApp::setup(){  
    // Set background color  
	ofBackground(55,55,55);  
    // load movie into player  
    // remember that the file "movie.mov" has to be in data/ folder  
	player.loadMovie("movie.mov");  
	// plays movie  
	player.play();  
}  
  
//--------------------------------------------------------------  
void testApp::update(){  
    // change movie frame  
    player.idleMovie();  
}  
  
//--------------------------------------------------------------  
void testApp::draw()  
{  
    // draw player  
    // arguments: x, y, width, height  
    // in this case draw movie at x: 20, y: 20  
    // with width: 320, height: 240  
    player.draw(20,20, 320, 240);  
}  
  
//--------------------------------------------------------------  
void testApp::keyPressed  (int key)  
{  
    switch(key){  
        case 'f':  
            ofToggleFullscreen(); // Change to fullscreen  
        break;  
    }  
}  
//--------------------------------------------------------------  
void testApp::keyReleased(int key){}  
//--------------------------------------------------------------  
void testApp::mouseMoved(int x, int y ){}  
//--------------------------------------------------------------  
void testApp::mouseDragged(int x, int y, int button){}  
//--------------------------------------------------------------  
void testApp::mousePressed(int x, int y, int button){}  
//--------------------------------------------------------------  
void testApp::mouseReleased(int x, int y, int button){}  
//--------------------------------------------------------------  
void testApp::resized(int w, int h){}  
  

Hope this helps you :smiley:

That helps me a LOT ! :smiley:

Thanks Alejandro.