Skip to content

Instantly share code, notes, and snippets.

@nickoneill
Created March 20, 2013 17:09
Show Gist options
  • Save nickoneill/5206442 to your computer and use it in GitHub Desktop.
Save nickoneill/5206442 to your computer and use it in GitHub Desktop.
Export a video path as mp4 and use the document interaction controller to send it
AVAsset *asset = [AVAsset assetWithURL:self.videoPaths[0]];
AVAssetExportSession *export = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetPassthrough];
[export setOutputURL:temp];
[export setOutputFileType:AVFileTypeMPEG4];
NSLog(@"export started");
[export exportAsynchronouslyWithCompletionHandler:^{
NSLog(@"export done: %d",[export status]);
UIDocumentInteractionController *interactionController = [UIDocumentInteractionController interactionControllerWithURL:temp];
[interactionController setDelegate:self];
// [interactionController presentOpenInMenuFromRect:CGRectMake(0, 0, 10, 10) inView:self.view animated:YES];
[interactionController presentPreviewAnimated:YES];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment