0
我試圖用看起來很標準的方式,使用MFMailComposeViewController將圖庫中的視頻附加到電子郵件中。將M4V視頻連接到電子郵件
使用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];
感謝