IOS How to export movie to camera roll
/* Export movie to camera roll */
- (void) saveVideoToAlbum:(NSString*)path {
if(UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(path)){
UISaveVideoAtPathToSavedPhotosAlbum (path, self, @selector(video:didFinishSavingWithError: contextInfo:), nil);
}
}
/* Call when finished save to camera */
- (void) video:(NSString *)videoPath didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
if(error) {
UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:@"Warning"
message:[error description]
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertview show];
[alertview release];
} else {
NSLog(@"Export done");
}
}
- (void) saveVideoToAlbum:(NSString*)path {
if(UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(path)){
UISaveVideoAtPathToSavedPhotosAlbum (path, self, @selector(video:didFinishSavingWithError: contextInfo:), nil);
}
}
/* Call when finished save to camera */
- (void) video:(NSString *)videoPath didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
if(error) {
UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:@"Warning"
message:[error description]
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertview show];
[alertview release];
} else {
NSLog(@"Export done");
}
}
Comments
Post a Comment