Picking video from PhotoLibrary with UIImagePickerController in OS 3.1

家住魔仙堡 提交于 2019-11-29 08:39:18

I got the imagepicker working on a 3g and a 3gs to pick videos.

NSArray *mediaTypesAllowed = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[imgPicker setMediaTypes:mediaTypesAllowed];

And to get the picked video

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
    NSString *mediaType = [info valueForKey:UIImagePickerControllerMediaType];
    if([mediaType isEqualToString:@"public.movie"]){...}
}
Deepak

Hey, I am also unable to get movie objects on 3G using the above mentioned code. It crashes on my 3G. It however works on my 3GS, but the issue is it shows a mix of both images and movies in photo library. I tried the following code:

videoPickerCtrl.sourceType =  UIImagePickerControllerSourceTypePhotoLibrary;

NSArray *mediaTypesAllowed = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary];

and on my 3GS running OS 3.1.2, it shows me videos cum images stored in my photo library.

Whereas if I try doing the following:

videoPickerCtrl.sourceType =  UIImagePickerControllerSourceTypePhotoLibrary;
NSArray *mediaTypesAllowed = [NSArray arrayWithObject:@"public.movie"];
[videoPickerCtrl setMediaTypes:mediaTypesAllowed];

Then all it shows me is videos stored in Camera Roll, and nothing else. Can somebody help ?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!