You can upload videos to Facebook using the Graph API in several ways. You can resume and not resume downloads.
The latter is the simplest; you send a message to graph-video.facebook.com, and the video data must be multipart/form-data encoded. Files are limited to 1 GB in size and 20 minutes in length.
You can upload videos using the SDK . For example, the following code will use the JS SDK:
FB.api( "/{user-id}/videos", "POST", { "source": "{video-data}" }, function (response) { if (response && !response.error) { } } );
Here, the source parameter is your encoded video file. See the docs for more information. Alternatively, if the video has already been downloaded somewhere, you can use the file_url parameter to provide a link to this video.
Note: the default JS SDK is graph.facebook.com, but you need to send a message to graph-video.facebook.com. So you need to redefine the domain or re-create the message with a regular JS HTTP request. In this case, use the source parameter and add access_token to the parameter with this name.
If you have more control over your video files and process, you can upload files to chunks . This will allow you to recover from lost download segments without having to re-download the entire file.
source share