0
我在這裏是新的,並且仍然開始,所以在這一點上我忍受。從NSBundle硬編碼視頻遷移,以允許圖像選擇器文件
我有上傳一個嵌入在項目中的「videoTest.MOV」文件的代碼。我想更改該代碼以上傳我從下面的視頻操作中包含的圖像選擇器代碼中選擇的視頻。
感謝您的幫助,我完全沉迷於此。
// Upload static file to Youtube
-(void)uploadVideoOnYouTube
{
_uploadVideo = [[YouTubeUploadVideo alloc] init];
_uploadVideo.delegate = self;
NSURL *VideoUrl = [[NSBundle mainBundle] URLForResource:@"videoTest" withExtension:@"MOV"];
NSData *fileData = [NSData dataWithContentsOfURL:VideoUrl];
NSString *title;
NSString *description;
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"'Test Video Uploaded ('EEEE MMMM d, YYYY h:mm a, zzz')"];
title = [dateFormat stringFromDate:[NSDate date]];
description = @"This is test";
[self.uploadVideo uploadYouTubeVideoWithService:self.youtubeService
fileData:fileData
title:title
description:description];
}
// Image Picker that only shows movies, no images.
- (IBAction)video:(id)sender {
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil];
[self presentModalViewController:imagePicker animated:YES];
}