title: Copy downloaded video to camera roll
body: <p>Even though it looks like a simple procedure, it's by now 3 hours I'm trying without success. I am probably missing something really stupid.</p>
  
  <p>So, I have this app downloading videos from the Internet. The videos are correctly stored locally because I can play them providing the local url. But, I can't succeed in copying the videos to the camera roll. Here is what I do:</p>
  
  <pre><code>    ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
      ALAssetsLibraryWriteVideoCompletionBlock videoWriteCompletionBlock =
      ^(NSURL *newURL, NSError *error) {
          if (error) {
              NSLog( @"Error writing image with metadata to Photo Library: %@", error );
          } else {
              NSLog( @"Wrote image with metadata to Photo Library %@", newURL.absoluteString);
          }
      };
  
      NSLog(@"file %@", localPath);
      NSURL *url = [NSURL fileURLWithPath:localPath isDirectory:NO];
      [library writeVideoAtPathToSavedPhotosAlbum:url
                                  completionBlock:videoWriteCompletionBlock];
  </code></pre>
  
  <p>But the output I get is:</p>
  
  <pre><code>2013-07-24 00:13:32.094 App[1716:907] file /var/mobile/Applications/70C18C4E-9F97-4A6A-B63E-1BD19961F010/Documents/downloaded_video.mp4
  2013-07-24 00:13:32.374 App[1716:907] Wrote image with metadata to Photo Library (null)
  </code></pre>
  
  <p>And of course the file is not saved in the camera roll. It's a simple mp4, compatible with the device I'm using (i.e. it should be possible to save it).</p>
  
  <p>I honestly have no idea what to do. Any hint will be highly appreciated. Thanks</p>