将视频复制到uipasteboard [英] copy video to uipasteboard

查看:128
本文介绍了将视频复制到uipasteboard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功使用以下代码将图像复制或添加到粘贴板:

I have successfully able to copy or add the image to pasteboard by using following code:

if (ver_float < 6.0)
{
    UIPasteboard *pasteboard;
    pasteboard = [UIPasteboard generalPasteboard];
    NSString *filePath =pathToImage;
    [pasteboard setImage:[UIImage imageWithContentsOfFile:filePath]];
}
else
{
    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
    NSString *filePath =pathToImage;
    NSData *videoData = [NSData dataWithContentsOfFile:filePath];
    [pasteboard setData:videoData forPasteboardType:[UIPasteboardTypeListImage objectAtIndex:0]];

}

NSURL *urlstr = [NSURL URLWithString:@"sms:"];
[[UIApplication sharedApplication] openURL:urlstr];

但我正在制作的应用程序基于图像和视频,因此用户将能够通过imessage或messagecomposer发送图像/视频。但是因为我已将图像转换为数据并添加到粘贴板中。它正在成功运作并通过imessage发送。但我还需要通过imessage发送视频。如果有人对此有任何想法,请提供一些建议或解决方案。

But the app which I am making is based on both images and videos so that user will be able to send image/video via imessage or messagecomposer. But as I have convert the image into data and added into pasteboard. It is working succesfully and sending through imessage. But I also need to send video via imessage. If anyone has any idea about this please provide me some suggestion or solution.

我非常感谢你的帮助。

推荐答案

我在从SMS发送音频文件时也遇到了同样的问题。
但是使用当前的SDK无法从SMS发送视频和音频。
您可以将该视频上传到服务器,然后发送上传的网址。

I have also faced the same issue in sending audio file from SMS. But sending video and audio from SMS is not possible with current SDK. You can do this by uploading that video to server and then send that uploaded URL.

如何以编程方式在iPhone上发送语音邮件?

这篇关于将视频复制到uipasteboard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆