Use ELCImagePickerController to select video

I try to select the ELCImagePickerController video from the photo library, but when I print it

 NSLog(@"%@",[dict valueForKey:@"UIImagePickerControllerMediaType"]); 

it returns ALAssetTypeVideo , not the type public.movie ,

I don't know if there is a way to select a movie (e.g. .mov) from ALAssetTypeVideo ?

Sorry, my English is not very good: ')

+7
source share
2 answers

Change the ALAssetsGroup filter to allAssets in the ELCAlbumPickerController.m file:

here:

  ALAssetsGroup *g = (ALAssetsGroup*)[assetGroups objectAtIndex:indexPath.row]; [g setAssetsFilter:[ALAssetsFilter allPhotos]]; 

and here:

 [picker.assetGroup setAssetsFilter:[ALAssetsFilter allPhotos]]; 
+6
source

We need to replace "allPhotos" with "allAssets" in ALAssetsFilter with
two places to display all assets (including video) in the ELCImagePickerController code
as indicated below

First change:

 ALAssetsGroup *g = (ALAssetsGroup*)[assetGroups objectAtIndex:indexPath.row]; [g setAssetsFilter:[ALAssetsFilter **allAssets**]]; 

Second:

In the tableView method didSelectRowAtIndexPath didSelectRowAtIndexPath:(NSIndexPath *)indexPath

 [picker.assetGroup setAssetsFilter:[ALAssetsFilter **allAssets**]]; 

But the thumbnail of the video image will be the same as the thumbnail image to change its spelling of its own code in the ELCAsset.m constructor of the initWithAsset:(ALAsset*)_asset class initWithAsset:(ALAsset*)_asset

For example:

check

 if ([self.asset valueForProperty:ALAssetPropertyType] == ALAssetTypeVideo ){ // code for video thumbnail } if ([self.asset valueForProperty:ALAssetPropertyType] == ALAssetTypePhoto ){ // code for Photo thumbnail } 
+3
source

All Articles