core-video-to-gif
v1.0.2
Published
a JavaScript library to convert video to gif
Downloads
12
Readme
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
“*” 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
upload(params, callback)
The api is still in draft. Not work!!!
Contributions
Your contributions and suggestions are welcome 😄😄😄