title: How do i get only the videos using ALAssetsLibrary
body: <p>I am trying to get videos present from the photo library from the following piece of code.But i also get images list.How do i get list of all videos? what am i doing wrong?</p>
  
  <pre><code>NSMutableArray* assetURLDictionaries = [[NSMutableArray alloc] init];
   xy =[[NSMutableArray alloc]init];
  ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
  
  void (^assetEnumerator)( ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop) {
      if(result != nil) {
          if([[result valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypeVideo]) {
              [assetURLDictionaries addObject:[result valueForProperty:ALAssetPropertyURLs]];
  
              NSLog(@"result is:%@",result);
              NSLog(@"asset URLDictionary is:%@",assetURLDictionaries);
              NSURL *url= (NSURL*) [[result defaultRepresentation]url];
  
              [library assetForURL:url
                       resultBlock:^(ALAsset *asset) {
                           [xy addObject:[UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage]]];
                           NSLog(@" xy is:%@",xy);
                           image =[ [UIImageView alloc ] initWithImage:[xy objectAtIndex:0]];
                           NSLog(@"image is:%@",image);
                       }
                      failureBlock:^(NSError *error){ NSLog(@"test:Fail"); } ];
          }
      }
  };
  
  NSMutableArray *assetGroups = [[NSMutableArray alloc] init];
  void (^ assetGroupEnumerator) ( ALAssetsGroup *, BOOL *)= ^(ALAssetsGroup *group, BOOL *stop) {
      NSLog(@"hello");
      if(group != nil) {
          [group enumerateAssetsUsingBlock:assetEnumerator];
          [assetGroups addObject:group];
          NSLog(@"Number of assets in group :%d",[group numberOfAssets]);
          NSLog(@"asset group is:%@",assetGroups);
      }
  };
  
  assetGroups = [[NSMutableArray alloc] init];
  
  [library enumerateGroupsWithTypes:ALAssetsGroupAll
                         usingBlock:assetGroupEnumerator
                       failureBlock:^(NSError *error) {NSLog(@"A problem occurred");}];
  </code></pre>