react-video-cropper

1.0.1 • Public • Published

react-video-cropper

react video cropper which crop images from videos

NPM JavaScript Style Guide

Install

npm install --save react-video-cropper

Usage

1. Basic usage

import VideoCropper from 'react-video-cropper'
import React, { useState } from 'react'
import video from './data/1.mp4'
const App = () => {
  const [imgList, setImgList] = useState([])
  return (
    <>
      <VideoCropper
        videoSrc={video}
        ButtonSize='20px'
        onCheckButton={(i) => {
          setImgList((prev) => [...prev, i])
        }}
      />
      {imgList.map((image) => (
        <img src={image} />
      ))}
    </>
  )
}

export default App

Props

Name Description Default
videoSrc video source to play video undefined
height Height of compenent video height
width Width of component video width
className css class name undefined
cropAspect Aspect ratio for crop selection undefined
onCheckButton call back function triger on check button with cropped image as parameter undefined
onCloseButton call back function trigger on close button undefined
CloseButtonIcon icon/text to show on close button (jsx element) cross icon
CheckButtonIcon icon/text to show on check button (jsx element) check icon
CloseButtonColor close button icon/font color #3da4ed
CheckButtonColor check button icon/font color #3da4ed
CloseButtonBackgroundColor clode button background color white
CheckButtonBackGroundColor check button background color white
ButtonSize size of close and check button 20px

License

MIT © srjchauhan

Package Sidebar

Install

npm i react-video-cropper

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

36.2 kB

Total Files

7

Last publish

Collaborators

  • srjchauhan