gpt4 book ai didi

ios - 无法设置不同的视频时长以在iOS中捕获和编辑视频

转载 作者:行者123 更新时间:2023-12-01 16:33:15 25 4
gpt4 key购买 nike

我正在进行一个项目,在该项目中,我需要设置1分钟的视频录制时间,但是用户应该并编辑并选择30秒持续时间的视频。

以下是我用于启用30秒最大编辑时间的代码。

-(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.videoMaximumDuration = 30;
cameraUI.delegate = delegate;

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

任何帮助将不胜感激。

最佳答案

苹果提供了用于视频编辑的示例。您可以在WWDC 2010示例代码包中引用AVEditDemo示例...。

关于ios - 无法设置不同的视频时长以在iOS中捕获和编辑视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30565581/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com