开发者

how to check video camera is available on iPhone

is there any way to check video camera capability ava开发者_运维百科ilable on iPhone?


Most of the camera related availability support is exposed through the UIImagePickerController. A bit tricker thing is detection of Video Camera. You can detect the presence of a video camera in a iOS device using the following method.

- (BOOL) isVideoCameraAvailable
{
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    NSArray *sourceTypes = [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType];
    [picker release];

    if (![sourceTypes containsObject:(NSString *)kUTTypeMovie ]){

        return NO;
    }

    return YES;
}


Found this code (based on UIDevice) which helped me with this issue:

https://github.com/MugunthKumar/DeviceHelper

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜