Use this library to add image/video editor to you React application.
This library contains drawing tools which you can use to draw graphical shapes on you image or video sources. Package contains ImageEditor and VideoEditor components.
NPM package:
yarn i react-media-editor
Also you can modify project files directly, project built using RollupJS module bundler.
To run example:
- go to /example folder
- yarn i
- yarn start
- open localhost:3000
You can review how to use ImageEditor on codesandbox:
Here is an example how to use VideoEditor compoent within you application:
import React from 'react'
import { SketchPicker } from 'react-color'
import { VideoEditor } from 'react-media-editor'
const Video = () => (
<div className="page-wrapper editor">
<div className="container">
<VideoEditor
colorPicker={SketchPicker}
src="https://your.video.mp4"
/>
</div>
</div>
)
export default Video
Result: Imgur
Example using ImageEditor:
import React from 'react'
import { SketchPicker } from 'react-color'
import { ImageEditor } from 'react-media-editor'
import ExampleImage from '../assets/img/example.png'
const Image = () => (
<div className="page-wrapper editor">
<div className="container">
<ImageEditor colorPicker={SketchPicker} src={ExampleImage} />
</div>
</div>
)
export default Image
Result: Imgur
If you want to enable color change feature you should add react-color package to your project, and then pass it's component as colorPainter prop to Editor. Example:
...
import { SketchPicker } from 'react-color' // we will use SketchPicker
...
// somwhere in the React render() method
<VideoEditor
colorPicker={SketchPicker}
src="https://your.video.mp4"
/>
...
colorPicker - react-color component to enable color pick feature.
src - image or video source.
If you would like to add comments to audio files please take a look on react-audio-comments library.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Vlad Morzhanov
Copyright (c) 2018 Vlad Morzhanov. You can review license in the LICENSE file.