Guest User

Untitled

a guest
Dec 16th, 2013
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. Video newVideo = new Video();
  2. newVideo.Title = title;
  3. newVideo.Tags.Add(new MediaCategory(category, YouTubeNameTable.CategorySchema));
  4. newVideo.Keywords = tag;
  5. newVideo.Description = description;
  6. newVideo.YouTubeEntry.Private = false;
  7. newVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag", YouTubeNameTable.DeveloperTagSchema));
  8. newVideo.YouTubeEntry.MediaSource = new MediaFileSource(localFile, "video/mp4");
  9. GDataCredentials credentials = new GDataCredentials(username, password);
  10. Authenticator youTubeAuthenticator = new ClientLoginAuthenticator(application,
  11. ServiceNames.YouTube, credentials);
  12. youTubeAuthenticator.DeveloperKey = developerKey;
  13. AtomLink link = new AtomLink("http://uploads.gdata.youtube.com/resumable/feeds/api/users/default/uploads");
  14. link.Rel = ResumableUploader.CreateMediaRelation;
  15. newVideo.YouTubeEntry.Links.Add(link);
  16. ResumableUploader ru = new ResumableUploader();
  17. ru.AsyncOperationCompleted += new AsyncOperationCompletedEventHandler(this.OnDone);
  18. ru.AsyncOperationProgress += new AsyncOperationProgressEventHandler(this.OnProgress);
  19. var tmpvalue = "PARS";
  20. ru.InsertAsync(youTubeAuthenticator, newVideo.YouTubeEntry, tmpvalue);
Advertisement
Add Comment
Please, Sign In to add comment