Created
March 20, 2013 17:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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