1.0.1 • Published 6 months ago

generate-video-thumbnail v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

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);
  });
1.0.1

6 months ago

1.0.0

6 months ago