开发者

load the videos in ipod/iphone library but always crash

开发者 https://www.devze.com 2023-02-09 08:50 出处:网络
I hope to load the videos in ipod/iphone library like app \'videos\'. the codes show below, but it always cause crash

I hope to load the videos in ipod/iphone library like app 'videos'. the codes show below, but it always cause crash

UIImagePickerController *picker=[[UIImagePickerController alloc]init];
picker.sourceType= UIImagePickerControllerSourceTypePhotoLibrary;
picker.mediaTypes = [NSArr开发者_运维问答ay arrayWithObject:kUTTypeMovie];
picker.delegate = self;

Welcome any comment

Thanks

interdeb


We need to know how you are presenting it as well and perhaps information about the line it crashed on if it happens to be in your code. Here is an example that works for me:

- (void)presentVideoPicker:(UIImagePickerControllerSourceType)sourceType
{
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.delegate = [self retain];
    picker.mediaTypes = [NSArray arrayWithObjects:(NSString*)kUTTypeMovie, kUTTypeImage, nil];
    picker.videoQuality = UIImagePickerControllerQualityTypeHigh;
    picker.allowsEditing = YES;
    picker.sourceType =  sourceType;

    [self.view.window.rootViewController presentModalViewController:picker animated:YES];
    [picker release];
}

I send it UIImagePickerControllerSourceTypeCamera or UIImagePickerControllerSourceTypePhotoLibrary

0

精彩评论

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