generate-video-thumbnail
v1.0.1
Published
> Generate video thumbnails from a video file
Downloads
12
Readme
Generate Video Thumbnail
Generate video thumbnails from a video file
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);
});