これが私のコードで、ビデオをYouTubeに正常にアップロードできます。ユーザー名とパスワードを使用していますが、代わりにアクセストークンを使用します。どうもありがとうございました。
GDataServiceGoogleYouTube *service = [self youTubeService];
NSURL *url = [GDataServiceGoogleYouTube youTubeUploadURLForUserID:kGDataServiceDefaultUser
clientID:@"test"];
NSData *data = [NSData dataWithContentsOfFile:videoPath];
NSString *filename = [videoPath lastPathComponent];
GDataMediaTitle *title = [GDataMediaTitle textConstructWithString:strVideoTitle_];
GDataMediaCategory *category = [GDataMediaCategory mediaCategoryWithString:strCategory_];
[category setScheme:kGDataSchemeYouTubeCategory];
GDataMediaDescription *desc = [GDataMediaDescription textConstructWithString:strVideoDescription];
GDataMediaKeywords *keywords = [GDataMediaKeywords keywordsWithString:strkeyWord_];
GDataYouTubeMediaGroup *mediaGroup = [GDataYouTubeMediaGroup mediaGroup];
[mediaGroup setMediaTitle:title];
[mediaGroup setMediaDescription:desc];
[mediaGroup addMediaCategory:category];
[mediaGroup setMediaKeywords:keywords];
[mediaGroup setIsPrivate:isPrivate_];
NSString *mimeType = [GDataUtilities MIMETypeForFileAtPath:videoPath
defaultMIMEType:@"video/mp4"];
GDataEntryYouTubeUpload *entry;
entry = [GDataEntryYouTubeUpload uploadEntryWithMediaGroup:mediaGroup
data:data
MIMEType:mimeType
slug:filename];
SEL progressSel = @selector(ticket:hasDeliveredByteCount:ofTotalByteCount:);
[service setServiceUploadProgressSelector:progressSel];
gDataServiceTicket_ = [[service fetchEntryByInsertingEntry:entry
forFeedURL:url
delegate:self
didFinishSelector:@selector(uploadTicket:finishedWithEntry:error:)] retain];