js-video-thumb-image
Create thumb image from video with input type file
Browser Support
Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
Installing
Using npm:
$ npm install js-video-thumb-image
Using bower:
$ bower install js-video-thumb-image
Using yarn:
$ yarn add js-video-thumb-image
Example
// used in comman js const thumbImage = ;document 0 ;// In success data will get object File: File; // file data base64Image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAA'; // base64 data error: false; // error false; imageUrl: 'blob:null/86bbb246-47a5-4285-aa0c-2a3532b58d53'; // image url __proto__: Object;// asnyc and awaitconst getThumbImage = async { const imageUrl File error base64Image = await ; if !error // view, upload };
using React and vue
;;const thumb = { const file setFile = React; const viewImage setViewImage = React; const createThumb = async { const File error imageUrl = await ; if !error ; }; return <> <input type='file' accept='video.*' onChange=createThumb /> <img src=viewImage alt='img' /> </> ;};