Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ofVideoPlayer: Cannot play more than 4 videos, even when more are loaded. #5542

Open
SuperMoran opened this issue Apr 13, 2017 · 1 comment

Comments

@SuperMoran
Copy link

SuperMoran commented Apr 13, 2017

Use of_0.9.8 and Windows10, in the use of the video player to open 11 video, but no matter how I can only play the first four videos. After the video settings play () still can not play, and the program will run after a number of crashes. Can you help me, thank you. @arturoc
This is my code:

//--------------------------------------------------------------
void ofApp::setup(){
	for (int i = 0; i < 11; i++) {
		vp.push_back(ofVideoPlayer());
		vp[i].load(ofToString(i + 1) + ".mp4");
		vp[i].play();
		vp[i].setPaused(true);
	}

	for (int i = 0; i < 11; i++) {
		ofLogNotice() << ofToString(vp[i].isPlaying());
	}
	num = 0;
}

//--------------------------------------------------------------
void ofApp::update() {
	if (vp[num].isPlaying()) {
		vp[num].update();
	}
	else {
		vp[num].play();
	}
}

//--------------------------------------------------------------
void ofApp::draw() {
	if (vp[num].isPlaying()) {
		vp[num].draw(0, 0);
	}
	string str = "num: " + ofToString(num);
	str += "\n isplaying: " + ofToString(vp[num].isPlaying());
	str += "\n isPaused: " + ofToString(vp[num].isPaused());
	ofDrawBitmapStringHighlight(str, 100, 100);
}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){
	if (key == '1'){
		vp[num].setPaused(false);
		vp[num].update();
	}
	if (key == '2') {
		vp[num].setPaused(true);
		if (++num >= 11) {
			num = 10;
		}
		vp[num].setPaused(false);	
		vp[num].update();
	}
	if (key == '3') {
		vp[num].setPaused(true);
		if (num-- <= 0) {
			num = 0;
		}		
		vp[num].setPaused(false);	
		vp[num].update();	
	}
}
@bakercp
Copy link
Member

bakercp commented May 19, 2017

Hi, can you zip up a demo project (with small videos) that reproduces this issue?

@bakercp bakercp self-assigned this May 19, 2017
@bakercp bakercp changed the title OfVideoPlayer open video is greater than four, but can only play the first four ofVideoPlayer: Cannot play more than 4 videos, even when more are loaded. May 22, 2017
@dimitre dimitre added the close label Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants