在UIImagePickerController中编辑视频时是否可以创建固定持续时间修剪窗口?

时间:2013-02-16 15:25:52

标签: iphone ios video uiimagepickercontroller avfoundation

我正在使用UIImagePickerController,如下面的代码所示。编辑视图显示修剪窗口,您可以拖动开始或结束。我希望能够创建一个可以滑动的固定持续时间修剪窗口。

有人知道这是否可行?或者有人知道自定义控件来实现这一目标吗?或者你可以建议一种自己创造的方法(如果它不是太复杂)?

- (BOOL) startCameraControllerFromViewController: (UIViewController*) controller
                                   usingDelegate: (id <UIImagePickerControllerDelegate,
                                                   UINavigationControllerDelegate>) delegate {

    if (([UIImagePickerController isSourceTypeAvailable:
          UIImagePickerControllerSourceTypeCamera] == NO)
        || (delegate == nil)
        || (controller == nil))
        return NO;


    UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
    cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;

    // Displays a control that allows the user to choose movie capture
    cameraUI.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];

    // Hides the controls for moving & scaling pictures, or for
    // trimming movies. To instead show the controls, use YES.
    cameraUI.allowsEditing = YES;

    cameraUI.delegate = delegate;

    [controller presentModalViewController: cameraUI animated: YES];
    return YES;
}

1 个答案:

答案 0 :(得分:0)

我已经知道如果你想创建一个固定的窗口修剪编辑控制器,你需要从头开始编码。 UIImagePickerController中没有选项来修复窗口大小。