🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more
Socket
Book a DemoInstallSign in
Socket

core-video-to-gif

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-video-to-gif

a JavaScript library to convert video to gif

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

core-video-to-gif

A JavaScript Library To Convert Video Fragments To Gif.

中文文档

Get Started

NPM

$ npm install core-video-to-gif --save

CDN

<script src="./dist/core-video-to-gif.min.js"></script>
const v2g = new CoreVideoToGif({
    // specify the video element
    el: document.querySelector('video')
})
v2g.shot({
    // options,
    start: 5, // ms
    end: 8
}, (result) => {
    // ...
    image.src = result
})

Params

keyTypeDetailsValue
* elElementThe video element<video ... >
workerScriptStringenable Web WorkerPlease inclued the [script](https://github.com/JackPu/core-video-to-gif/blob/master/examples/gif.worker.js), and specify the path
widthNumberThe output git width600(default: the video original height)
heightNumberThe output gif image height600(default: the video original height)
maxTimeNumberlimit the time of gif animation5(default: 10)
fpsNumberthe frame per second12(default: 6)
qualityNumberthe quality of gif(1-10) The best is 10
onStartShotFunctioncall when start shoting
onGifProcessFunctioncall when making gif
onGifFinishedFunctioncall when gif output

“*” means it is required.

API

shot(params, callback)

You could use the method to get the video screenshots.

// get current screenshot
v2g.shot( (result) => {
   // ...
   image.src = result
})
// get screenshot from 5s - 8s
v2g.shot({
   // options,
   start: 5, // ms
   end: 8
}, (result) => {
   // ...
   image.src = result
})

params

keyTypeDetailsValue
startNumberthe screenshot start time6(s)
endNumberthe screenshot end time7(s)

upload(params, callback)

The api is still in draft. Not work!!!

Contributions

Your contributions and suggestions are welcome 😄😄😄

MIT License

FAQs

Package last updated on 17 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts