Style inborn

Style inborn

  • NA
  • 3
  • 1.8k

How to resolve the issue of uploading the video on youtube ?

Jul 11 2013 1:46 PM
Hi all,

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 

code is given below:-

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...:(

Answers (3)