Skip to content

Issues with movie players and scenes. #12

@fred-dev

Description

@fred-dev

I am having some issues using the current master of OF on OSX 10.15.3.
When I have an ofVideoPlayer or ofxHapPlayer in a scene the renderer acts very strangely, when I leave the scene the last played frame of video will stay, but at a different size. The scene manager will also not go to next and previous scene properly, I can go to the scene with a movie in it once but not again, not using previous and next scene and not by calling gotoScene with either the name or the numerical ID.

Here is a sample scene I have been using to test.


pragma once

#include <ofxAppUtils.h>
#include "ofxHapPlayer.h"
class MovieScene : public ofxFadeScene {

	public:

		// set the scene name through the base class initializer
		MovieScene() : ofxFadeScene("Movie"){
			setSingleSetup(true); // call setup each time the scene is loaded
			setFade(1000, 1000); // 1 second fade in/out
		}

		// scene setup
		void setup() {
            vid.load("SampleHap.mov");
            //vid.stop();
		}

		// called when scene is entering, this is just a demo and this
		// implementation is not required for this class
		void updateEnter() {
		
			// called on first enter update
			if(isEnteringFirst()) {
				ofLogNotice("MovieScene") << "update enter";
			}
		
			// fade scene calculates normalized alpha value for us
			ofxFadeScene::updateEnter();
			
			// finished entering?
			if(!isEntering()) {
				ofLogNotice("MovieScene") << "update enter done";
                vid.setPosition(0);
                vid.play();
			}
		}

		// normal update
		void update() {
            vid.update();
		}

		// called when scene is exiting, this is just a demo and this
		// implementation is not required for this class
		void updateExit() {
            vid.stop();
		}

		// draw
		void draw() {
            vid.draw(0,0);
		}
		
		// cleanup
		void exit() {
		
		}

    ofxHapPlayer vid;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions