2.0.1 • Published 5 years ago

facebook-api-video-upload v2.0.1

Weekly downloads
434
License
MIT
Repository
github
Last release
5 years ago

facebook-api-video-upload

Upload a video in chunk on the facebook api. more info

Install

$ npm i facebook-api-video-upload --save

Tested on OS X and Linux.

Usage

const fs = require('fs');
const fbUpload = require('facebook-api-video-upload');

const args = {
  token: "YOURTOKEN", // with the permission to upload
  id: "YOURID", //The id represent {page_id || user_id || event_id || group_id}
  stream: fs.createReadStream('./fixture.mp4'), //path to the video,
  title: "my video",
  description: "my description",
  thumb: {
    value: fs.createReadStream('./fixture.jpg'),
    options: {
      filename: 'fixture.jpg',
      contentType: 'image/jpg'
    }
  }
  // if you want the default thumb from the video just remove the field
  // you can add any extra fields from the api https://developers.facebook.com/docs/graph-api/reference/page/videos/#Creating
  // all keys except token, id, stream are passed to the final request
};

fbUpload(args).then((res) => {
  console.log('res: ', res);
  //res:  { success: true, video_id: '1838312909759132' }
}).catch((e) => {
  console.error(e);
});```

## License
MIT © [MrdotB](https://github.com/MRdotB)
2.0.1

5 years ago

2.0.0

5 years ago

1.4.1

5 years ago

1.4.0

6 years ago

1.3.2

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago