npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

video-frame-cover

v2.0.4

Published

video capture frame picture

Downloads

85

Readme

video-frame-cover

Capture preview image from a video file

Installation

npm install video-frame-cover --save

Usage Examples

Browser usage

<script src="https://unpkg.com/[email protected]/dist/index.global.js"></script>
import videoFrameCover from "video-frame-cover";

Javascript

videoFrameCover({
    url: this.videoUrl, // video url
    quality: 0.9,
    imageType: 'image/jpeg',
    isCheckBackgroundColor: true, // Check whether the image is a solid color
    success: (res, e) => {
        this.imgsrc = res
    }
})

example

online example

Options

url

Type: String

Default: true

video link

currentTime

Type: Number

Default: false

The default value is 1. If the value is 0, a black screen may be displayed

quality

Type: Number

Default: false

Image quality 0.2-0.95 If the value is 1, the size of base64 will be increased

imgWidth

Type: Number

Default: false

Generate image width, height will be calculated according to video aspect ratio

imageType

Type: String

Default: false

Image type image/png is similar to this format

isCheckBackgroundColor

Type: Boolean

Default: false

Whether to verify that the picture is a solid color, the default is false, if enabled, the picture is a solid color, and the next second video picture will be automatically obtained

Event

downloadFile(base64)

Download video frame pictures

previousFrame()

Get the video picture of the previous second

nextFrame()

Get the next second video picture

appointFrame(time)

time how many seconds of the picture to get the specified frame video picture

const videoFrameCover = new VideoFrameCover({
    url: './thwj.mp4', 
    quality: 0.9,
    imageType: 'image/jpeg',
    isCheckBackgroundColor: true,
    success: (res) => {
        this.imgsrc = res
    }
})

videoFrameCover.downloadFile(this.imgsrc)
videoFrameCover.previousFrame()
videoFrameCover.nextFrame()
videoFrameCover.appointFrame(23) // Picture at 23 seconds