YouTube C# API Upload Large Video -
i trying upload 500 mb video youtube, using c# api. on last line, receive argument null exception. uri, second argument, supposed be? here code:
[webmethod] public string insertvideotoyoutube(filestream fs, string filename, string title, string description, string username, string password) { video newvideo = new video(); newvideo.title = title; newvideo.tags.add(new mediacategory("sports", youtubenametable.categoryschema)); newvideo.description = description; newvideo.youtubeentry.private = false; newvideo.youtubeentry.mediasource = new mediafilesource(fs, path.getfilename(filename), "video/x-ms-wmv"); var youtubeauthenticator = new clientloginauthenticator("kenticovideo", servicenames.youtube, new gdatacredentials(username, password)); youtubeauthenticator.developerkey = "xxx"; resumableuploader uploader = new resumableuploader(256); uploader.insert(youtubeauthenticator, new uri("http://www.mysite.com"), fs, "video/x-ms-wmv", ""); // start upload }
here stack trace:
system.argumentnullexception: value cannot null. parameter name: uristring @ system.uri..ctor(string uristring) @ google.gdata.client.resumableupload.resumableuploader.initiateupload(uri resumableuploaduri, authenticator authentication, string contenttype, string slug, int64 contentlength, string httpmethod) @ google.gdata.client.resumableupload.resumableuploader.initiateupload(uri resumableuploaduri, authenticator authentication, string contenttype, string slug, int64 contentlength) @ google.gdata.client.resumableupload.resumableuploader.insert(authenticator authentication, uri resumableuploaduri, stream payload, string contenttype, string slug, asyncdata data) @ google.gdata.client.resumableupload.resumableuploader.insert(authenticator authentication, uri resumableuploaduri, stream payload, string contenttype, string slug) @ preveaytproxy.insertvideotoyoutube(filestream fs, string filename, string title, string description, string username, string password) in c:\inetpub\wwwroot\customers\imaginasium\preveaytproxy\app_code\preveaytproxy.cs:line 57 @ _default.page_load(object sender, eventargs e) in c:\inetpub\wwwroot\customers\imaginasium\preveaytproxy\default.aspx.cs:line 20 @ system.web.util.callieventhandlerdelegateproxy.callback(object sender, eventargs e) @ system.web.ui.control.onload(eventargs e) @ system.web.ui.control.loadrecursive() @ system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint, boolean includestagesafterasyncpoint)
am using correct code? looked here, cannot find code need:
https://groups.google.com/forum/#!topic/gdata-dotnet-client-library/awopgb9_nze
Comments
Post a Comment