upload youtube video without youtube api
How can we upload video to Youtube without using its api in asp.net? My requirement is that user uploads video to our site and after admin approval that video is uploaded to Youtube开发者_运维问答. I'm using ASP.NET
Have you looked at this? http://code.google.com/apis/youtube/2.0/developers_guide_dotnet.html#Direct_Upload
Authentication code can be found on the same page. http://code.google.com/apis/youtube/2.0/developers_guide_dotnet.html#Authentication
Jason I'm using this code:
Dim request As YouTubeRequest
Dim newVideo As 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)
newVideo.YouTubeEntry.MediaSource = New MediaFileSource("c:\\flame.avi", "video/quicktime")
Dim createdVideo As Video = request.Upload(newVideo)
But where to specify Youtube credentials and key?
Dim settings As YouTubeRequestSettings = New YouTubeRequestSettings("youtube", developerKey, username, password)
Dim request As New YouTubeRequest(settings)
Dim newVideo As 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)
newVideo.YouTubeEntry.MediaSource = New MediaFileSource("c:\\drop.avi", "video/x-msvideo")
Dim createdVideo As Video = request.Upload(newVideo)
精彩评论