'Google.YouTube.Video.Tags' is not supported by the language

122 Views Asked by At

When i compile I am getting this error (c#):

'Google.YouTube.Video.Tags' is not supported by the language

Video video = new Video();
    video.Title = txtTitle.Text;
    video.Tags.Add(new MediaCategory(cmbCat.SelectedItem.ToString(),YouTubeNameTable.CategorySchema ));

What is the reason for this error ?

1

There are 1 best solutions below

0
On

For Google API v3, the correct parameter for video.Tags.Add is a string parameter. MediaCategory is not a valid data type for the Add Method of the Tags property.

video.Tags.Add("Keyword1");
video.Tags.Add("Keyword2");
video.Tags.Add("Keyword3");

or

video.Tags=new string[] {"Keyword1","Keyword2","Keyword3"};

See Google's sample at UploadVideo.cs