ios调用摄像头默认为摄像

            if(![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])

            {

                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"错误提示" message:@"没有发现摄像头" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil];

                [alert show];

                return;

            }

            UIImagePickerController *pickerVideo = [[UIImagePickerController alloc] init];

            pickerVideo.sourceType = UIImagePickerControllerSourceTypeCamera;

            pickerVideo.delegate = self;

            pickerVideo.allowsEditing = YES;

            pickerVideo.videoQuality = 2;

            pickerVideo.videoMaximumDuration = 60.0f;

            pickerVideo.cameraDevice = UIImagePickerControllerCameraDeviceFront;

            pickerVideo.mediaTypes = [NSArray arrayWithObject:@"public.movie"];

            [self presentViewController:pickerVideo animated:YES completion:nil];

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。