I am developing an application is uploading video to youtube with Youtube Api 2.0 on C#
Here is my code
Video newVideo = new Video();
newVideo.Title = "kankaaaa";
newVideo.Tags.Add(new MediaCategory("Autos", YouTubeNameTable.CategorySchema));
newVideo.Keywords = "education, funny deneme";
newVideo.Description = "bilgi mi istiyorsun";
newVideo.YouTubeEntry.Private = false;
newVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag",
YouTubeNameTable.DeveloperTagSchema));
newVideo.YouTubeEntry.MediaSource = new MediaFileSource("c:\\cat.flv",
"video/quicktime");
// newVideo.Private = true;
Video createdVideo = Request.Upload(newVideo);
Video class is under Google.YouTube namespace.
I can upload video without any problem. When Requested completed it returns an object which type is Video.
But I want to see detail of processing. I mean percent of uploading. I searched and I found two functions are getUploadState() and getProgress(). But I cant find it on youtube api.
there is just Status class member of the Video Class. It shows result of video. But I want to learn uploading process detail. Such as 40% completed..
What should I use ? I thought that I could Backgroundworker but I am not sure if it works.
I solved my own problem.. it was a bit difficult but I finally did 🙂
And you can access information of uploaded video in OnDone event with AsyncOperationCompletedEventArgs e parameter and property is ResponseStream