Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion addons/ofxiOS/src/video/ofxiOSVideoPlayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
bool ofxiOSVideoPlayer::load(string name) {

if(!videoPlayer) {
videoPlayer = (__bridge void *)[[AVFoundationVideoPlayer alloc] init];
videoPlayer = (__bridge_retained void *)[[AVFoundationVideoPlayer alloc] init];
[(__bridge AVFoundationVideoPlayer *)videoPlayer setWillBeUpdatedExternally:YES];
}

Expand Down Expand Up @@ -86,6 +86,7 @@

((__bridge AVFoundationVideoPlayer *)videoPlayer).delegate = nil;

__autoreleasing AVFoundationVideoPlayer *player = (__bridge_transfer AVFoundationVideoPlayer *)videoPlayer;
if(bTextureCacheSupported == true) {
killTextureCache();
}
Expand Down
Binary file not shown.
19 changes: 19 additions & 0 deletions examples/ios/simpleMovieExample/src/main.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "ofApp.h"

int main() {

// here are the most commonly used iOS window settings.
//------------------------------------------------------
ofiOSWindowSettings settings;
settings.enableRetina = false; // enables retina resolution if the device supports it.
settings.enableDepth = false; // enables depth buffer for 3d drawing.
settings.enableAntiAliasing = false; // enables anti-aliasing which smooths out graphics on the screen.
settings.numOfAntiAliasingSamples = 0; // number of samples used for anti-aliasing.
settings.enableHardwareOrientation = false; // enables native view orientation.
settings.enableHardwareOrientationAnimation = false; // enables native orientation changes to be animated.
settings.glesVersion = OFXIOS_RENDERER_ES1; // type of renderer to use, ES1, ES2, etc.

ofCreateWindow(settings);

return ofRunApp(new ofApp);
}
26 changes: 26 additions & 0 deletions examples/ios/simpleMovieExample/src/ofApp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#pragma once

#include "ofxiOS.h"

class ofApp : public ofxiOSApp {

public:
void setup();
void update();
void draw();
void exit();

void touchDown(ofTouchEventArgs & touch);
void touchMoved(ofTouchEventArgs & touch);
void touchUp(ofTouchEventArgs & touch);
void touchDoubleTap(ofTouchEventArgs & touch);
void touchCancelled(ofTouchEventArgs & touch);

void lostFocus();
void gotFocus();
void gotMemoryWarning();
void deviceOrientationChanged(int newOrientation);

ofVideoPlayer player_;

};
79 changes: 79 additions & 0 deletions examples/ios/simpleMovieExample/src/ofApp.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){
player_.load("hands.m4v");
player_.play();
}

//--------------------------------------------------------------
void ofApp::update(){
player_.update();

if (ofGetElapsedTimef() > 10) {
player_.close();
}
}

//--------------------------------------------------------------
void ofApp::draw(){
ofBackground(0,0,0);
if (player_.isLoaded()) {
player_.draw(0,0);

} else {
ofDrawBitmapString("Player was unloaded sucessfully after 10 seconds", 20,20);
}
}

//--------------------------------------------------------------
void ofApp::exit(){

}

//--------------------------------------------------------------
void ofApp::touchDown(ofTouchEventArgs & touch){

}

//--------------------------------------------------------------
void ofApp::touchMoved(ofTouchEventArgs & touch){

}

//--------------------------------------------------------------
void ofApp::touchUp(ofTouchEventArgs & touch){

}

//--------------------------------------------------------------
void ofApp::touchDoubleTap(ofTouchEventArgs & touch){

}

//--------------------------------------------------------------
void ofApp::touchCancelled(ofTouchEventArgs & touch){

}

//--------------------------------------------------------------
void ofApp::lostFocus(){

}

//--------------------------------------------------------------
void ofApp::gotFocus(){

}

//--------------------------------------------------------------
void ofApp::gotMemoryWarning(){

}

//--------------------------------------------------------------
void ofApp::deviceOrientationChanged(int newOrientation){

}