9
下面的代碼失敗了嗎?可能是什麼問題?如何使用C#中的Youtube API將視頻上傳到YouYube?
YouTubeRequestSettings settings = new YouTubeRequestSettings("whatwill come here ?",
"my api key",
"my youtube login email", "my youtube login password");
YouTubeRequest request = new YouTubeRequest(settings);
Video newVideo = new Video();
newVideo.Title = "test 1";
newVideo.Tags.Add(new MediaCategory("Gaming", YouTubeNameTable.CategorySchema));
newVideo.Keywords = "test 1 , test 2";
newVideo.Description = "test 3 test 4";
newVideo.YouTubeEntry.Private = false;
newVideo.Tags.Add(new MediaCategory("tag 1, tag 2",
YouTubeNameTable.DeveloperTagSchema));
newVideo.YouTubeEntry.Location = new GeoRssWhere(37, -122);
newVideo.YouTubeEntry.MediaSource = new MediaFileSource("C:\\test.avi", "video/quicktime");
Video createdVideo = request.Upload(newVideo);
我解決了這個問題。這是我的分類:類別必須是遊戲而不是遊戲。
[YouTube API集成ASP.NET - 使用單個頁面上傳視頻]的可能副本(http://stackoverflow.com/questions/629435/youtube-api-integration-asp-net-upload-video-with-一個單頁) – 2011-01-21 21:51:17