我想选择一个位于我的iphone上的视频文件,并将其上传到服务器。如何选择一个视频文件并在iphone上以编程方式上传到服务器
由于UIImagePicker用于选择我们的照片库或其他模式中可用的图片,是否有任何选择以编程方式选择位于我们的iphone中的文件?
在此先感谢。
我想选择一个位于我的iphone上的视频文件,并将其上传到服务器。如何选择一个视频文件并在iphone上以编程方式上传到服务器
由于UIImagePicker用于选择我们的照片库或其他模式中可用的图片,是否有任何选择以编程方式选择位于我们的iphone中的文件?
在此先感谢。
首先添加MediaPlayer
框架...
然后下载型MP4的视频从mobile9.com
然后使用代码如下
NSString *url=[[NSBundle mainBundle] pathForResource: @"video" ofType:@"mp4"];
MPMoviePlayerController *play1= [[MPMoviePlayerController alloc] initWithContentURL:[NSURL
fileURLwithPath:url];
[play1 setOrientation:UIDeviceOrientationPortrait animated:YES];
[paly1 play];
试试这个代码.....它的工作..
to select video from photo library use following code:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil];
[self presentViewController:imagePicker animated:YES completion:NULL];
您好,感谢的答复,是资产产生库是唯一的选择? – SriPriya 2011-01-20 10:22:09