Friday, April 22, 2011

Video Upload Just Added: How to publish a video to Facebook

First make sure that you are authorized to publish to the user's feed with the **publish_stream** permission.

Then use the api commands to send the video to the server.

Dim FB As New SessionInfo("[access_token]")
Dim Posts = New Functions.Posts(FB)
Dim img As String = "[Local video Location]"
Dim F = New IO.FileStream(img, IO.FileMode.Open, IO.FileAccess.Read)
Dim B(F.Length - 1) As Byte
F.Read(B, 0, B.Length)
F.Close()
Dim VideoID = Posts.PublishVideo("[Album ID]", "[title]", "[description]", B)   
  
Tagging users in videos is not yet supported by Facebook.

2 comments:

  1. Not at the moment but I will try and touch base with you tomorrow to help you out. You can use the same commands with C# as VB, the syntax is just a little different but all the inputs and outputs are the same. Because this is a .net library, you can use it in any .net project.

    ReplyDelete