0

hi i am getting all photos and videos thumbnails from ALAsset library.
my code works fine i am getting photos and video thumbnail.but in video thumbnail missing Video icon and its time stamp.

[assetImageView setImage:[UIImage imageWithCGImage:[self.asset thumbnail]]];

enter image description here


i am getting like above..i am using ELCImagePickerDemp API

enter image description here


i need to get like this i am missing time and icon in lower right corner thumbnail. any help will be appreciated... THX

Bad Boy
  • 628
  • 2
  • 5
  • 23

2 Answers2

2

The assetslibrary thumbnail as you noticed does not include the symbol and time information in the thumbnail. So you have to draw those yourself on the thumbnail using the information you get from Alassetslibrary (check ALAssetPropertyType and ALAseetPropertyDuration to get the info you need to draw these yourself).

Cheers,

Hendrik

holtmann
  • 6,043
  • 32
  • 44
  • ok thx.. if u have any links can u share me to draw video icon and time at the bottom of thumbnail icon – Bad Boy Jun 06 '12 at 09:06
0

Replace filter in code form "allPhotos" with "allAssets" in two places in ELCAlbumPickerController.m class

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

                  // replace [g setAssetsFilter:[ALAssetsFilter allPhotos]];  as it filter only photo
                   [g setAssetsFilter:[ALAssetsFilter allAssets]];  //gives allassets
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 

 // replace [picker.assetGroup setAssetsFilter:[ALAssetsFilter allPhotos]]; as it filer only photo 
    **[picker.assetGroup setAssetsFilter:[ALAssetsFilter allAsset]];** // gives allassets
}

now all asset will be shown in Library.To differentiate between video and image thumbnail , you now have to add some code ELCAsset.m class in constructor

-(id)initWithAsset:(ALAsset*)asset_ {
if ([self.asset valueForProperty:ALAssetPropertyType] == ALAssetTypeVideo ){
         // code for video thumbnail 
       // you can use this link to understand video thumbnail 
     //http://stackoverflow.com/questions/11688938/alasset-thumbnail-at-specific-timestamp
}

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

}
Mohit Nigam
  • 454
  • 5
  • 10