是否有任何其他API可以提供更改" cameraDevice"后方和前方? 旁边" UIImagePickerController"的cameraDevice属性?
答案 0 :(得分:0)
这个功能让我解决了这个问题。
- (AVCaptureDevice *)frontFacingCamera
{
NSArray *videoDevices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
AVCaptureDevice *captureDevice = nil;
for (AVCaptureDevice *device in videoDevices)
{
if (device.position == AVCaptureDevicePositionFront) {
captureDevice = device;
break;
}
}
return captureDevice;
}