Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Video newVideo = new Video();
- newVideo.Title = title;
- newVideo.Tags.Add(new MediaCategory(category, YouTubeNameTable.CategorySchema));
- newVideo.Keywords = tag;
- newVideo.Description = description;
- newVideo.YouTubeEntry.Private = false;
- newVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag", YouTubeNameTable.DeveloperTagSchema));
- newVideo.YouTubeEntry.MediaSource = new MediaFileSource(localFile, "video/mp4");
- GDataCredentials credentials = new GDataCredentials(username, password);
- Authenticator youTubeAuthenticator = new ClientLoginAuthenticator(application,
- ServiceNames.YouTube, credentials);
- youTubeAuthenticator.DeveloperKey = developerKey;
- AtomLink link = new AtomLink("http://uploads.gdata.youtube.com/resumable/feeds/api/users/default/uploads");
- link.Rel = ResumableUploader.CreateMediaRelation;
- newVideo.YouTubeEntry.Links.Add(link);
- ResumableUploader ru = new ResumableUploader();
- ru.AsyncOperationCompleted += new AsyncOperationCompletedEventHandler(this.OnDone);
- ru.AsyncOperationProgress += new AsyncOperationProgressEventHandler(this.OnProgress);
- var tmpvalue = "PARS";
- ru.InsertAsync(youTubeAuthenticator, newVideo.YouTubeEntry, tmpvalue);
Advertisement
Add Comment
Please, Sign In to add comment