开发者

how to check video camera is available on iPhone

开发者 https://www.devze.com 2023-03-15 03:21 出处:网络
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 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

精彩评论

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