我正在尝试在iPad上录制视频。我有以下代码显示记录屏幕,但我想为此添加一个时间限制(准确地说是20秒)。
虽然我有下面的代码,如果有更好的方法,我很乐意改变它。
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.delegate = self;
picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
[self presentViewController:picker animated:YES completion:NULL];
答案 0 :(得分:0)
一旦用户开始录制,请尝试创建20秒计时器。如果在计时器到期之前按下停止按钮,则终止计时器。如果计时器达到零,那么您可以[[videoController captureManager] stopRecording];