health03adv / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

system.outofmemoryexception on Upload large Video (500mb) on youtube google-gdata .net API #512

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

string developerKey = 
"AI39si5jEvO_F4HUPbnRAz9WB-pV8Zqg0Jszguelg9B15dqu7SqK7IDkd3xirT9nRQuUoxPtmKjolrg
6HhM_DbLDxOSe7lC8AA";
        string username = "vbvspl@gmail.com";
        string password = "@lt12345";
        YouTubeRequestSettings settings = new YouTubeRequestSettings("Videoapp", null, developerKey, username, password);
        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("c:\\mnt_hood.avi", "video/x-msvideo");
        try
        {
            Video createdVideo = request.Upload(newVideo);
        }
        catch (Exception ex)
        {

        }

Original issue reported on code.google.com by shivakat...@gmail.com on 5 Jun 2011 at 6:27

GoogleCodeExporter commented 8 years ago
When uploading big files you should use the ResumableUpload component instead 
of the standard Upload method.

The YouTubeUploader sample can be used as reference:

http://www.google.com/codesearch/p?hl=en#VETFb4oZYpw/clients/cs/samples/YouTubeU
ploader/YouTubeUploader/YouTubeUploader.cs

Original comment by ccherub...@google.com on 7 Jun 2011 at 2:59

GoogleCodeExporter commented 8 years ago
Thanks for reply 
But i have implement google data code (YouTube) on web pages with no using csv 
file ..
please provide me .aspx and .cs pages 

i am waiting your reply 

thanks   

Original comment by shivakat...@gmail.com on 8 Jun 2011 at 5:22

GoogleCodeExporter commented 8 years ago
The code to upload a video using resumable upload can be found in 
YouTubeUploader.InsertVideo():

http://www.google.com/codesearch/p?hl=en#VETFb4oZYpw/clients/cs/samples/YouTubeU
ploader/YouTubeUploader/insertandretry.cs

You basically have to create a YouTubeEntry with your data and then pass it to 
the InsertAsync() method of the ResumableUploader component.

Since the insert operation is asynchronous you have to track the 
AsyncOperationCompleted and AsyncOperationProgress events to get status updates.

Original comment by ccherub...@google.com on 8 Jun 2011 at 8:46

GoogleCodeExporter commented 8 years ago

hello 

thanks for reply ..
i have implemented this code but i found Exception on this line (may be user 
state u)

ru.InsertAsync(youTubeAuthenticator, newVideo.YouTubeEntry, u)

__________Exception 
_______________________________________________________________

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the 
current web request. Please review the stack trace for more information about 
the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to 
an instance of an object.
___________________________________________________________________________

please provide me code for .aspx and .cs ( Web CODE upload ) 
not a desktop project  code , no using csv file
if any documentation implement code please send me 

i am waiting your reply 

thanks 

Original comment by shivakat...@gmail.com on 8 Jun 2011 at 1:57

GoogleCodeExporter commented 8 years ago
You are probably not instantiating ru, the ResumableUploader component.

Anyway, this is not the correct place for programming questions, you may try 
asking for support on Google Groups:

https://groups.google.com/forum/#!forum/gdata-dotnet-client-library

Original comment by ccherub...@google.com on 8 Jun 2011 at 2:02