我正在尝试以看似标准的方式使用 MFMailComposeViewController 将画廊中的视频附加到电子邮件中。
视频使用 GPUImage 框架以 m4v 格式录制,并通过自定义选择器进行选择。
选择器返回给我一个 ALAsset,我从中检索一个 URL(我已经将它启动到 MPMoviePlayerViewController 中,它存在并且可以正常播放)。
当电子邮件启动以进行预览时,它有一个视频图标,它认为它已附加了视频。
当我将其发送到电子邮件地址时,该电子邮件根本没有附件。你能帮我找出下面的代码有什么问题吗?
MFMailComposeViewController *mailpicker = [[MFMailComposeViewController alloc] init] ;
mailpicker.mailComposeDelegate = self;
mailpicker.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal ;
[mailpicker setSubject:@"Test email!"];
NSData *movieData = [NSData dataWithContentsOfURL:[[asset defaultRepresentation] url]];
NSLog(@"%@", [[asset defaultRepresentation] url]);
//I have tried all of the following;
[mailpicker addAttachmentData:movieData mimeType:@"video/x-m4v" fileName:@"Video.m4v"];
//[mailpicker addAttachmentData:movieData mimeType:@"application/m4v" fileName:@"Video.m4v"];
//[mailpicker addAttachmentData:movieData mimeType:@"video/m4v" fileName:@"Video.m4v"];
NSString *emailBody = @"Hey!";
[mailpicker setMessageBody:emailBody isHTML:YES];
[self presentModalViewController:mailpicker animated:YES];
谢谢