我要通过电子邮件单击摄像机按钮中的发送视频或图像,图像发送成功,但视频不发送。我正在使用这种编码的东西。有什么解决办法吗?
@IBAction func forwardButtonClicked(_ sender: Any) {
if type == .add {
if contact != nil {
MailMessageStore.shared.sendEmail() { (success) in }
} else {
showError()
}
} else {
let subject = "TOCA Note-\(contact.fullName ?? "-")"
let body = "Export from TOCA\n Contact Name: \(contact.fullName ?? "-")\n Company: \(contact.companyName ?? "-")\n Notes from \(notes.date!)\n\n Note:\n\(notes.notes!)"
SVProgressHUD.show()
print(self.notes.audio)
print(self.notes.image)
print(self.notes.video)
dispatch_main_after(0.001, {
MailMessageStore.shared.sendEmail(emailSubject: subject, emailBody: body, imageData: self.notes.imageURL != nil ? try? Data(contentsOf: self.notes.imageURL): nil, audioData: self.notes.audioURL != nil ? try? Data(contentsOf: self.notes.audioURL) : nil, videoData: self.notes.videoURL != nil ? try? Data(contentsOf: self.notes.videoURL) : nil) { (success) in
if success! {
SVProgressHUD.showSuccess(withStatus: "Email sent successfuly")
}
}
})
}
}