如何从iPhone应用程序捕获视频?

| 我在按下录制按钮的同时打开视频模式。然后,我可以捕获视频。捕获后,视频记录必须停止。现在,在屏幕下方的左侧是显示重新拍摄按钮,在右侧是使用按钮。这是我的问题开始了,如果按“使用”按钮,如何将视频的其他名称保存在特定的文件夹中?以及如何从该特定文件夹访问该视频? 请提供示例代码以解决此问题。 提前致谢, 森蒂库玛     
已邀请:
        您将必须实现成为
UIImagePickerController
对象的委托并像这样实现
imagePickerController:didFinishPickingMediaWithInfo:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    // This is the URL where the movie is stored (in the tmp directory)
    NSURL *movieURL = [info objectForKey:UIImagePickerControllerMediaURL];

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@\"movie.mov\"]; // You will have to vary this.
    NSURL *fileURL = [NSURL URLWithString:filePath];

    NSError *error;
    if ( [[NSFileManager defaultManager] moveItemAtURL:movieURL toURL:fileURL error:&error] ) {    
        NSLog(@\"Error copying: %@\", [error localizedDescription]);
    }

    [self dismissModalViewControllerAnimated:YES];
}
    

要回复问题请先登录注册