Friday, February 24, 2012

[YouTube-API] Re: Failed Uploads Youtube API .Net

Hello Josh,

That looks fairly similar to what I see in the sample code.

You could also ask in the .NET client library forum if you think the
issue lies in a bug in the client library:

https://groups.google.com/group/gdata-dotnet-client-library

Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev


On Feb 22, 12:24 pm, Josh <cdg.j...@googlemail.com> wrote:
> Hello Jeff,
> first thanks for your answer. I followed the code which is written in
> the documentation of the .Net Api. It didn't work, so I tried to
> take the code of the sample which is included. But it also failed. So
> i switched back to my first method.
>
> My Code looks like the following:
>
> Video vid = new Video();
> string contentType =
> MediaFileSource.GetContentTypeForFileName(source);
> vid.MediaSource = new MediaFileSource(source, contentType);
> vid.Title = title;
> vid.Description = description;
> vid.Keywords = tags;
> vid.Tags.Add(new MediaCategory("Games",
> YouTubeNameTable.CategorySchema));
> vid.Private = true;
>
> ((GDataRequestFactory)request.Service.RequestFactory).Timeout =
> int.MaxValue;
>
> AtomLink link = new AtomLink("http://uploads.gdata.youtube.com/
> resumable/feeds/api/users/" + "default" + "/uploads");
> link.Rel = ResumableUploader.CreateMediaRelation;
> vid.YouTubeEntry.Links.Add(link);
>
> request.Service.InsertAsync(new Uri("http://uploads.gdata.youtube.com/
> resumable/feeds/api/users/" + "default" + "/
> uploads"),vid.YouTubeEntry,vid);
>
> I really don't know whats wrong with this. Well i will study the
> sample again and try to find out whats wrong with mine. However it
> would be nice if you can tell me what i did wrong.
>
> Josh

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment