Saving the Video

The info dictionary returned by the video picker contains a UIImagePickerController-MediaURL key. This media URL points to the captured video, which is stored in a temporary folder within the app sandbox. Use the UISaveVideoAtPathToSavedPhotosAlbum() function to store the video to your library.

This save method takes four arguments: the path to the video you want to add to the library, a callback target, a selector with three arguments (basically identical to the selector used during image save callbacks), and an optional context. The save method calls the target with that selector after it finishes its work, allowing you to check for success.

Recipe 8-3 Recording Video

- (void)video:(NSString *)videoPath ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.