First you should submit an application to google.
So go to this link :
and create a project.
Note : I don't show you how to create project in google. So you can see some tutorials about it. It is really easy.
So as I said, we will use Google libraries to obtain some functions.
You can get these libraries from :
Add all libraries to your project and make this references:
Code:
using Google.GData.Client; using Google.YouTube;
Add these codes to your button_click event:
Code:
YouTubeRequestSettings settings = new YouTubeRequestSettings("appname", "devkey", "account mail", "account pw"); YouTubeRequest request = new YouTubeRequest(settings);
What does need the object that named "request"? Video ID and rating count.
So we need specify video ID from video url.
Code:
Uri videoUrl = new Uri("http://gdata.youtube.com/feeds/api/videos/" + "videoID");
If you don't know that what is youtube video ID, it is like it:
Now we should create video object that holding the video informations.Quote:
www.youtube.com/watch?v=XMb63nsvQMo
Red colored text is the ID.
Code:
Video video = request.Retrieve<Video>(videoUrl);
Code:
video.Rating = 5
We did all we need. Except doing request to server.
Code:
request.Insert(video.RatingsUri, video);
Please send message or come skype if you troubled with this tutorial.