01
public
string
UploadVideo(
FilePath,
Title,
Description)
02
{
03
04
05
06
07
settings =
new
YouTubeRequestSettings(
"Lakshya"
, devkey, username, password) { Timeout = -1};
08
request =
YouTubeRequest(settings);
09
Video newVideo =
Video();
10
newVideo.Title = Title;
11
newVideo.Tags.Add(
MediaCategory(
"Comedy"
, YouTubeNameTable.CategorySchema));
12
newVideo.Description = Description;
13
newVideo.Private =
false
;
14
newVideo.YouTubeEntry.Private =
15
newVideo.YouTubeEntry.MediaSource =
MediaFileSource(FilePath,
"video/mp4"
);
16
Video createdVideo = request.Upload(newVideo);
17
18
return
createdVideo.VideoId;
19
20
21
}