Im using ZXing, is working fine on my new app, but i would like to integrate the option of front or rear camera,
so far the only reference to this i’ve found is on the google group
But is not very clear what they mean with that,
so any pointers on what i have to do to accomplish this?
thanks !
ZXWidgetController doesn’t provide that functionality and it’s not really set up to make it easy to change.
The code that needs to change is in
- (void)initCapture. It calls[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]. This returns the default camera and you don’t want the defalt.You need code similar to that in
- (ZXCaptureDevice*)devicein ZXCapture.mm. That code won’t work out of the box (it’s designed to work with both AVFF and QTKit) but it’s the same idea. Instead of using the default video input device, go through the devices and look at devicepositionto find the device you want.Be nice to port that code to the widget but that hasn’t happened at this point.