Picking video from PhotoLibrary with UIImagePickerController in OS 3.1

后端 未结 2 741
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-18 14:37

I am trying to pick a video from the photo library. In principle I know how to do it you set the mediaType of the image picker to an NSArray with kUTTypeMovie as its only ob

2条回答
  •  感动是毒
    2020-12-18 15:02

    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 ?

提交回复
热议问题