标签:
- (AVCaptureDevice *)getFrontCamera
{
//获取前置摄像头设备
//过AVCaptureDevice的类方法devices或devicesWithMediaType去获取全部或局部设备列表
NSArray *cameras = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
for (AVCaptureDevice *device in cameras)
{
if (device.position == AVCaptureDevicePositionFront)
return device;
}
return [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
}
标签:
原文地址:http://www.cnblogs.com/pp-pping/p/4441002.html