My current attempt involves using the following code to upload a non-resumable video from my disk to my Facebook profile with Javascript.
FB.setAccessToken(accessToken);
let vid = "file:///D:/videos/vid.mp4";
//also tried with "D://videos/vid.mp4"
FB.api(
"/me/videos ",
"POST",
{
"source": vid,
"filename": "vid.mp4"
},
function (response) {
console.log(JSON.stringify(response, null, 4));
}
);
However, every time I run this code, I encounter an error within seconds.
{
"error": {
"message": "There was a problem uploading your video file. Please try again.",
"type": "OAuthException",
"code": 390,
"error_subcode": 1363030,
"is_transient": true,
"error_user_title": "Video Upload Time Out",
"error_user_msg": "Your video upload timed out before it could be completed. This is probably because of a slow network connection or because the video you're trying to upload is too large. Please try again.",
"fbtrace_id": "GwPTrdyQe7z"
}
}
I have reviewed the documentation in search of any parameters related to timeouts but have had no success.
Can anyone offer guidance on what mistake I may be making here?