0
我有以下代碼,它保存從相機膠捲中選擇的UIImage或視頻。使用從AVRURLAsset從相機膠捲保存的視頻 - initWithURL - iPhone
NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
[self dismissModalViewControllerAnimated:YES];
if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) {
introImage = [info objectForKey:UIImagePickerControllerOriginalImage];
//Unhide our UIImage Preview and insert our chosen Video or Intro.
selectIntroButton.hidden = YES;
selectedIntro.hidden = NO;
cancelIntroChoiceButton.hidden = NO;
selectedIntro.image = introImage;
}
else if ([mediaType isEqualToString:(NSString *)kUTTypeMovie])
{
//Create variable for video.
AVURLAsset *asset=[[AVURLAsset alloc] initWithURL:??? options:nil];
AVAssetImageGenerator *generator = [[AVAssetImageGenerator alloc] initWithAsset:asset];
generator.appliesPreferredTrackTransform=TRUE;
[asset release];
CMTime thumbTime = CMTimeMakeWithSeconds(0,30);
我的問題是如何將所選視頻提供給AVURLAssset initWithURL?什麼類型的對象是[info objectForKey:UIImagePickerControllerOriginalImage]返回?
謝謝。