Click here to Skip to main content
15,900,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

I want to Upload a video file from my Asp.net(c#) application to Youtube With its GoogleData Api for that i have created account in youtube also and also got the developer key for that application

I'd like to upload video and then save its URL so that I can view it later on.

from this article

http://code.google.com/apis/youtube/2.0/developers_guide_dotnet.html#Direct_Upload

Articles i come to know about two types of uploading so i have used direct uploading in my application.

now when i run that code in my application it gives me following error:

Execution of request failed: http://uploads.gdata.youtube.com/feeds/api/users/Youtube/uploads

My code is:

C#
YouTubeRequestSettings settings =
                     new YouTubeRequestSettings("ApplicationName", "Developer key");
        YouTubeRequest request = new YouTubeRequest(settings);

Video newVideo = new Video();

        newVideo.Title = "My Test Movie";
        newVideo.Tags.Add(new MediaCategory("Autos", YouTubeNameTable.CategorySchema));
        newVideo.Keywords = "cars, funny";
        newVideo.Description = "My description";
        newVideo.YouTubeEntry.Private = false;
        newVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag",
          YouTubeNameTable.DeveloperTagSchema));

        newVideo.YouTubeEntry.Location = new GeoRssWhere(37, -122);
        // alternatively, you could just specify a descriptive string
        // newVideo.YouTubeEntry.setYouTubeExtension("location", "Mountain View, CA");

        newVideo.YouTubeEntry.MediaSource = new MediaFileSource(strpath,
          "video/quicktime");
      
            Video createdVideo = request.Upload("ApplicationName",newVideo);


Please provide me the exact code or any parameters or any steps to complete this
Any help would be appreciated..

Thanks,
Msheth
Posted
Updated 15-Sep-10 3:28am
v2
Comments
Dalek Dave 15-Sep-10 9:28am    
Edited for Code Block.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900