get-video-screenshot
v1.0.1
Published
Library to capture screnshots / thumbnails as images from a videos. Only works in the browser.
Downloads
38
Maintainers
Readme
Get Video Screenshot
Library to get screenshots of a video at any given time. Dependency free (other than the browser itself, does not work on node).
Usage
import GetVideoScreenshot from "get-video-screenshot";
const videoScreenshotGetter = GetVideoScreenshot(<Video Source>);
* Returns a `videoScreenshotGetter` object.
videoScreenshotGetter.get({time: <Int, Seconds>})
* Returns a promise with the image source as payload.
Example Usage.
import GetVideoScreenshot from "get-video-screenshot";
const videoScreenshotGetter = GetVideoScreenshot("./video.mp4");
const videoThumbnailSrc = await videoScreenshotGetter.get({ time: 1 });
// render to image to an <img /> tag
document.querySelector("img[data-thumbnail-render]").src = videoThumbnailSrc;