Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

how to switch front and rear camera? #1

Closed
zinwalin opened this issue Oct 9, 2015 · 2 comments
Closed

how to switch front and rear camera? #1

zinwalin opened this issue Oct 9, 2015 · 2 comments

Comments

@zinwalin
Copy link

zinwalin commented Oct 9, 2015

thanks.

@remirobert
Copy link
Owner

CameraEngine is still under development. It's ready for a production, but some APIs are missing, like this one. I will add it quickly. 😉

@remirobert
Copy link
Owner

Done !.

So now for change the device rotation, it's very simple :

//In a button action trigger : 
- (IBAction)switch:(id)sender {
    AVCaptureDevicePosition current = [CameraEngine shareInstance].devicePosition;

    [CameraEngine shareInstance].devicePosition = (current == AVCaptureDevicePositionBack) ? AVCaptureDevicePositionFront : AVCaptureDevicePositionBack;
}

// Or manually :
[CameraEngine shareInstance].devicePosition = AVCaptureDevicePositionFront;
[CameraEngine shareInstance].devicePosition = AVCaptureDevicePositionBack;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants