title: ALAssetsLibrary getting the path of a video and play it later
body: <p>Using below code I am able to get the video files in tableview. But I am unable to get the path to the video so that I would save it and use it later to play.</p>
  
  <pre><code>    - (void)viewDidLoad {
  
      [super viewDidLoad];
      [activity startAnimating];
  
      assets = [[NSMutableArray alloc] init];
      library = [[ALAssetsLibrary alloc] init];
  
      UIImage *viewImage;
  
      [library writeImageToSavedPhotosAlbum:[viewImage CGImage] orientation:(ALAssetOrientation)[viewImage imageOrientation] completionBlock:^(NSURL *assetURL, NSError *error){  
          if (error) {  
              NSLog(@"error");  
          } else {  
              NSLog(@"url %@", assetURL);
  
  
          }  
      }];  
  
  
      [library enumerateGroupsWithTypes:ALAssetsGroupAll  usingBlock:^(ALAssetsGroup *group, BOOL *stop){
  
          if (group != NULL) {
  
              [group enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop){
  
  
                  if ([[result valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypeVideo]) {
                      NSLog(@"asset: %@", result);
                      [assets addObject:result];
                  }
  
              }];
          }
  
          [self.tableview reloadData];
          [self.activity stopAnimating];
          [self.activity setHidden:YES];
  
      }
             failureBlock:^(NSError *error){
  
                  NSLog(@"failure"); }];
  
  }
  
  
  // Customize the number of sections in the table view.
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
      return 1;
  }
  
  // Customize the number of rows in the table view.
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
      return [assets count];
  }
  
  // Customize the appearance of table view cells.
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
      static NSString *CellIdentifier = @"Cell";
  
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
      }
  
      ALAsset *asset = [assets objectAtIndex:indexPath.row];
      [cell.imageView setImage:[UIImage imageWithCGImage:[asset thumbnail]]];
      [cell.textLabel setText:[NSString stringWithFormat:@"Video %d", indexPath.row+1]];
  
      return cell;
  }
  </code></pre>
  
  <p>This is my output:</p>
  
  <pre><code>2012-07-19 12:37:42.135 mptest[17310:707] asset: ALAsset - Type:Video, URLs:{
      "com.apple.quicktime-movie" = "assets-library://asset/asset.MOV?id=336068EA-C1B1-481C-82DA-F2419561A91A&amp;ext=MOV";
  }
  2012-07-19 12:37:42.147 mptest[17310:707] asset: ALAsset - Type:Video, URLs:{
      "com.apple.quicktime-movie" = "assets-library://asset/asset.MOV?id=A1CBDDE4-4BC1-48F2-84E0-028D7B7F4879&amp;ext=MOV";
  }
  2012-07-19 12:37:42.156 mptest[17310:707] asset: ALAsset - Type:Video, URLs:{
      "com.apple.quicktime-movie" = "assets-library://asset/asset.MOV?id=3D76ABC7-515C-42E7-A940-B149C78FBAB6&amp;ext=MOV";
  }
  2012-07-19 12:37:42.262 mptest[17310:707] error
  </code></pre>
  
  <p>Can anyone help me wih this issue?</p>