I am facing the problem of uploading the video on you tube , when i upload the video of .5 MB , it is successfully uploaded, when i try to upload the video of 10 MB then i am facing the problem of uploading the video on you tube
public string UploadVideo(string FilePath, string Title, string Description)
{
Video createdVideo = null;
try
{
settings = new YouTubeRequestSettings("Lakshya", devkey, username, password);
request = new YouTubeRequest(settings);
Video newVideo = new Video();
newVideo.Title = Title;
newVideo.Tags.Add(new MediaCategory("Comedy", YouTubeNameTable.CategorySchema));
newVideo.Description = Description;
newVideo.Private = false;
newVideo.YouTubeEntry.Private = false;
newVideo.YouTubeEntry.MediaSource = new MediaFileSource(FilePath, "video/mp4");
createdVideo = request.Upload(newVideo);
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
return createdVideo.VideoId;
}
Error:- "Object reference not set to an instance of an object"... I don't know what should i do in that case. small video is successfully uploaded while for 10MB video i got the error...:(