为iphone 3g ios 4挑选并上传视频

为iphone 3g ios 4挑选并上传视频,iphone,video,upload,uiimagepickercontroller,Iphone,Video,Upload,Uiimagepickercontroller,我想把一段视频从iPhone上传到某个服务器上 我在这里找到了一个有用的问题,可以从iPhone上传视频到服务器上 这里唯一的问题是选择视频。代码使用uiimagepickercontroller拾取视频,我有一部3g手机,它的照片应用程序中没有视频。我甚至连视频都放不进去。我只有一个iTunesU的视频。目前,我正在为uiimagepickercontroller使用以下代码段 if ([UIImagePickerController isSourceTypeAvailable:

我想把一段视频从iPhone上传到某个服务器上

我在这里找到了一个有用的问题,可以从iPhone上传视频到服务器上

这里唯一的问题是选择视频。代码使用uiimagepickercontroller拾取视频,我有一部3g手机,它的照片应用程序中没有视频。我甚至连视频都放不进去。我只有一个iTunesU的视频。目前,我正在为uiimagepickercontroller使用以下代码段

if ([UIImagePickerController isSourceTypeAvailable:
         UIImagePickerControllerSourceTypeSavedPhotosAlbum]) {
        UIImagePickerController *picker =
        [[UIImagePickerController alloc] init];
        picker.delegate = self;
        picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        [self presentModalViewController:picker animated:YES];
        [picker release];
    }
    else {
        UIAlertView *alert = [[UIAlertView alloc]
                              initWithTitle:@"Error accessing photo library"
                              message:@"Device does not support a photo library"
                              delegate:nil
                              cancelButtonTitle:@"Drat!"
                              otherButtonTitles:nil];
        [alert show];
        [alert release];
    }
因此,我不得不问,是否有必要从uiimagepickercontroller中挑选视频,如果有必要,我如何使用我的iPhone 3G这样做

如果这个问题不可读,请告诉我


谢谢。

据我所知,3G没有视频支持

为了使它工作(你可以模拟它),你需要传递一个“kutTypeMedia”的mediaType,它在你的设备上不可用

“如果”您想要测试,您可以将捆绑包中的视频复制到您的摄像机卷中,并在模拟器上进行测试

将视频从捆绑包复制到您的相机卷时,请执行以下操作:

从捆绑包中复制视频文件并将其保存到相册,如下所示

“捆绑路径: (其中APPLCIATIONGUID和user是动态的,取决于登录的用户和applicationGUID)

“/Users/user/Library/Application Support/iPhone Simulator/4.0/Applications/APPLICATIONGUID/Documents”

其中APPLICATIONGUID是与特定项目关联的GUID。您可以通过查找appropraite.app文件确认您位于正确的文件夹中

注意://我不相信这会对MOV起作用,但除了.m4v之外,我什么也没试过

NSString  *filePath = [NSHomeDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"Documents/VID_0001.m4v"]];

NSString  *videoFilepath = [[NSBundle mainBundle] pathForResource:@"VID"  ofType:@"m4v"];
NSLog(@"Filepath is: %@", videoFilepath);

//test video can save to the photos album first - code missing

UISaveVideoAtPathToSavedPhotosAlbum(filePath, self, @selector(video:didFinishSavingWithError:contextInfo:), nil);*
完成此操作后,相册中的视频可供选择是否使用正确的媒体类型设置UIImagePickerController


这是我看到的唯一一个选择,您必须在没有3GS的情况下使用视频。

据我所知,3G没有视频支持

为了使它工作(你可以模拟它),你需要传递一个“kutTypeMedia”的mediaType,它在你的设备上不可用

“如果”您想要测试,您可以将捆绑包中的视频复制到您的摄像机卷中,并在模拟器上进行测试

将视频从捆绑包复制到您的相机卷时,请执行以下操作:

从捆绑包中复制视频文件并将其保存到相册,如下所示

“捆绑路径: (其中APPLCIATIONGUID和user是动态的,取决于登录的用户和applicationGUID)

“/Users/user/Library/Application Support/iPhone Simulator/4.0/Applications/APPLICATIONGUID/Documents”

其中ApplicationUID是与特定项目关联的GUID。您可以通过查找appropraite.app文件来确认您在正确的文件夹中

注意://我不相信这会对MOV起作用,但除了.m4v之外,我什么也没试过

NSString  *filePath = [NSHomeDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"Documents/VID_0001.m4v"]];

NSString  *videoFilepath = [[NSBundle mainBundle] pathForResource:@"VID"  ofType:@"m4v"];
NSLog(@"Filepath is: %@", videoFilepath);

//test video can save to the photos album first - code missing

UISaveVideoAtPathToSavedPhotosAlbum(filePath, self, @selector(video:didFinishSavingWithError:contextInfo:), nil);*
完成此操作后,相册中的视频可供选择是否使用正确的媒体类型设置UIImagePickerController

这是唯一的选择,我看到你必须与没有3GS的视频工作