![](/img/trans.png)
[英]How to set a 10 second limit to video recording and in real time remove the 10 seconds old film parts - Swift iOS
[英]How to limit video crop section for 10 seconds in iOS?
嘗試此代碼。
-(void)recordVideo{
imagePicker = [[UIImagePickerController alloc]init];
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [[NSArray alloc]initWithObjects:(NSString *) kUTTypeMovie, (NSString *) kUTTypeMPEG4, nil];
imagePicker.videoQuality = UIImagePickerControllerQualityTypeIFrame1280x720;
[imagePicker setVideoMaximumDuration:10.0f];
sourceType = [UIImagePickerController availableMediaTypesForSourceType:imagePicker.sourceType];
if (![sourceType containsObject:(NSString *) kUTTypeMovie]) {
NSLog(@"Can not Save Video");
}
[self presentModalViewController:imagePicker animated:YES];
}
確保在顯示控制器之前必須將allowsEditing
設置為YES
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.