在我的应用程序中,我需要从模拟器中获取视频,我需要上传到服务器。任何人都可以帮助我。请尽快提供任何解决方案。
感谢和问候 沙蚕
最佳答案
首先,创建一个UIImagePickerController
在您的类(class)中,您需要实现 UIImagePickerControllerDelegate 协议(protocol)并将其连接到选取器的委托(delegate)属性。一旦用户选择了某些内容,您应该能够从 didFinishPickingMediaWithInfo 中获取所选媒体的位置。
//不在模拟器中检查iOS设备
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// this is the file system url of the media
NSURL* videoUrl = [info objectForKey:UIImagePickerControllerMediaURL];
// TODO: read in data at videoUrl and write upload it to your server
}
关于ios - 如何从iOS应用程序内的图库中获取视频(如图像),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20737723/