gpt4 book ai didi

ios - UIImagepicker 显示图像捕获而不是视频录制

转载 作者:行者123 更新时间:2023-11-29 02:08:28 26 4
gpt4 key购买 nike

我正在使用 UIImagepickerController 在我的应用程序中捕获视频。有时它的行为很奇怪 - 图像捕获即将到来。大多数情况下,当新用户注册并 try catch 视频或安装并测试新的 ipa 文件时会出现这种情况。尽管它是随机出现的。

当我提示 UIImagepickerController 时,它显示拍照按钮(白色按钮)而不是视频录制按钮(红色按钮)

这是我的代码 -

 UIImagePickerController *imagePicker=[[UIImagePickerController alloc]init];
imagePicker.delegate=self;
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
imagePicker.allowsEditing = YES;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
}
[self presentViewController:imagePicker animated:YES completion:NULL];

最佳答案

只需尝试用此替换您的代码。

    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
// picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMoviekUTTypeImage];
picker.mediaTypes = [NSArray arrayWithObjects:(NSString *)kUTTypeMovie,nil];
//picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;

[self presentViewController:picker animated:YES completion:NULL];

关于ios - UIImagepicker 显示图像捕获而不是视频录制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29538041/

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