我想獲得用戶選擇的視頻長度。即時通訊使用蘋果UIImagePicker,取消UIImagePicker後獲取視頻的長度?
這裏是我到目前爲止的代碼:
[self dismissModalViewControllerAnimated:YES];
//assign the mediatype to a string
//check the media type string so we can determine if its a video
NSURL *videoURL = [info objectForKey:UIImagePickerControllerMediaURL];
webData = [[NSData alloc]init];
webData = [NSData dataWithContentsOfURL:videoURL];
//[self post:webData];
video = 1;
upload.hidden = NO;
ImagesCopy = [[NSMutableArray alloc]initWithObjects:@"1", nil];
[tableview reloadData];
感謝:d
此鏈接可以幫助你 HTTP ://stackoverflow.com/questions/1616146/getting-duration-of-video-taken-by-camera-iphone-sdk – Naveen