Menu Home

iOS:UIImagePickerController限制选择视频文件

#import <MobileCoreServices/MobileCoreServices.h>

    UIImagePickerController *videoCapture = [[UIImagePickerController alloc] init];
    NSArray *availableTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
    if ([availableTypes containsObject:(__bridge NSString *)kUTTypeMovie]) {
        [videoCapture setMediaTypes:@[(__bridge NSString *)kUTTypeMovie)]];
    }

Categories: iOS

Tagged as:

lnmcc

Leave a Reply

Your email address will not be published.