Upload Video to Facebook Using Actionscrpt 3.0
For the last one week am searching for uploading video to Facebook using Graph Api from Flash. First challenge is to find something which will help to capture video from webcamera and convert it to ByteArray.
The problem is Actionscript doesn't had any utlity to save video from webcamera. It uses Flash media server to save video. But i need something which not uses any server side acript.
After searching several hours in google i found a link.
http://www.zeropointnine.com/blog/updated-flv-encoder-alchem/
In this utility it uses snapshots from the webcamera which will encode it . Though it had some drawbacks and limitations, it serves my requirement for small videos. I used it for creating videos.
Next i need to upload video to facebook. This is the api used to connect facebook using Actionscript.
http://code.google.com/p/facebook-actionscript-api/
This API uses a different function for uploading videos to facebook .Facebook.uploadVideo(). The reason for different function is that , Facebook uses a different API Url https://graph-video.facebook.com unlike the normal URL https://graph.facebook.com. I have attached the source here.
Code Explained
I used FacebookConnectLogin class for my facebook authentication and activities. For the video part plaese refer the above mentioned link.
The problem is Actionscript doesn't had any utlity to save video from webcamera. It uses Flash media server to save video. But i need something which not uses any server side acript.
After searching several hours in google i found a link.
http://www.zeropointnine.com/blog/updated-flv-encoder-alchem/
In this utility it uses snapshots from the webcamera which will encode it . Though it had some drawbacks and limitations, it serves my requirement for small videos. I used it for creating videos.
Next i need to upload video to facebook. This is the api used to connect facebook using Actionscript.
http://code.google.com/p/facebook-actionscript-api/
This API uses a different function for uploading videos to facebook .Facebook.uploadVideo(). The reason for different function is that , Facebook uses a different API Url https://graph-video.facebook.com unlike the normal URL https://graph.facebook.com. I have attached the source here.
Code Explained
I used FacebookConnectLogin class for my facebook authentication and activities. For the video part plaese refer the above mentioned link.
public function uploadVideo(br:ByteArray)
{
//Alert.show("facebook");
var obj:Object=new Object();
obj.title = "Vidoe upload";
obj.description = "video testing";
obj.fileName ="test"+Math.random()+".flv"
obj.video = br;
Facebook.uploadVideo("/me/videos",videoUploaded,obj);
}
private function videoUploaded(response:Object,fail:Object)
{
if (response)
{
Alert.show("succes");
}
if (fail)
{
Alert.show("failed");
}
}
This is the code for uploading video to facebook. The only parameter you are concerned about is the obj.video. Here we pass the ByteArray from the FlvEncoder.NOTE:1. Try some small video files like 5 - 10 secs long. Above these, it's possible to crash your browser.
And also it will take long time to upload video to facebook
2. And also check Facebook Policies and terms to know the limitations.
Comments
RES
Share Photos and Win Prizes
Go here to Download Facebook videos online in HD quality for free.
weather
facebook video downloader
usps tracking
youtube to mp3
Plants vs Zombies , Solitaire,Tom And Jerry Games, Brain Games, Happy Wheels , FNAF World
www.swesub.tv
www.pubfilm.ws
Watch Independence Day: Resurgence
Movies of action on 123movies
Music Online on Kissanime
Watch Invasion of the Body Snatchers Online
War Movies
Animazione Cineblog01
Cool Cool
!!!
great !
www.123-movies.me
www.123-movies.biz
fmovies-to.com
alta definizione
Zeesa Water Solutions
yesmovies.me
colleges in greater noida
Top MSC IT
colleges in greater noida
Top M
TECH colleges in greater noida