generate-video-thumbnail
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Generate Video Thumbnail

Generate video thumbnails from a video file

demo

Install

npm install --save generate-video-thumbnail

Usage

generateVideoThumbnails(selectedFile, numberOfThumbnails)

Async/Await (Typescript & ES7)

generateVideoThumbnails(videoFile, numberOfThumbnails)
  .then((thumbnailArray) => {
    // output will be arry of base64 Images
    // example - ["img1", "imgN"]
    // @todo - implement your logic here
  })
  .catch((err) => {
    console.error(err);
  });

generateVideoThumbnails(selectedFile, numberOfThumbnails, type, callback)

Callback response (Typescript & ES7)

const callback = (thumbnail, index) => {
  // thumbnail = base64 image
  // index = position on the final thumbnailArray
  // @todo - implement your logic here
};

generateVideoThumbnails(videoFile, numberOfThumbnails, type, callback)
  .then((thumbnailArray) => {
    // output will be arry of base64 Images
    // example - ["img1", "imgN"]
    // @todo - implement your logic here
  })
  .catch((err) => {
    console.error(err);
  });

Readme

Keywords

none

Package Sidebar

Install

npm i generate-video-thumbnail

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

12.4 kB

Total Files

6

Last publish

Collaborators

  • hunghg255