Bhavin Ramani
Bhavin Ramani

Reputation: 3219

showing video as well as image in ELCImagepicker

I have implement the ElCImagePicker code to my app for select multiple images.But when i click on to select_images button then it showing images very good and also can select images but my problem is that it showing videos on list of imagesscreenshot. so what changes to do for show only images not video..

-(void)viewDidAppear:(BOOL)animated
{
    ELCImagePickerController *elcPicker = [[ELCImagePickerController alloc] initImagePicker];

    elcPicker.maximumImagesCount = 10; //Set the maximum number of images to select to 100
    elcPicker.returnsOriginalImage = YES; //Only return the fullScreenImage, not the fullResolutionImage
    elcPicker.returnsImage = YES; //Return UIimage if YES. If NO, only return asset location information
    elcPicker.onOrder = YES; //For multiple image selection, display and return order of selected images
    elcPicker.mediaTypes = @[(NSString *)kUTTypeImage, (NSString *)kUTTypeMovie]; //Supports image and movie types

    elcPicker.imagePickerDelegate = self;

    [self presentViewController:elcPicker animated:YES completion:nil];
}

- (void)displayPickerForGroup:(ALAssetsGroup *)group
{
     ELCAssetTablePicker *tablePicker = [[ELCAssetTablePicker alloc] initWithStyle:UITableViewStylePlain];
     tablePicker.singleSelection = YES;
     tablePicker.immediateReturn = YES;

     ELCImagePickerController *elcPicker = [[ELCImagePickerController alloc] initWithRootViewController:tablePicker];
     elcPicker.maximumImagesCount = 1;
     elcPicker.imagePickerDelegate = self;
     elcPicker.returnsOriginalImage = YES; //Only return the fullScreenImage, not the fullResolutionImage
     elcPicker.returnsImage = YES; //Return UIimage if YES. If NO, only return asset location information
     elcPicker.onOrder = NO; //For single image selection, do not display and return order of selected images
     tablePicker.parent = elcPicker;

// Move me
    tablePicker.assetGroup = group;
    [tablePicker.assetGroup setAssetsFilter:[ALAssetsFilter allAssets]];

    [self presentViewController:elcPicker animated:YES completion:nil];
}

EDIT:-

I got my answer for above question but those selected images is shown in imageview in scrollview in this code but anyone know the code for show those selected images to collection view.

Upvotes: 0

Views: 587

Answers (1)

Michael Dautermann
Michael Dautermann

Reputation: 89559

I see a line in your code that says:

elcPicker.mediaTypes = @[(NSString *)kUTTypeImage, (NSString *)kUTTypeMovie]; //Supports image and movie types

Change that to:

elcPicker.mediaTypes = @[(NSString *)kUTTypeImage]; //Supports image types

and see what happens.

Upvotes: 2

Related Questions