GithubHelp home page GithubHelp logo

morzhanov / react-media-editor Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 4.0 18.68 MB

React components library to edit Images and Video using canvas.

License: MIT License

JavaScript 98.66% HTML 0.48% CSS 0.86%
react npm media screenshots editor library react-library

react-media-editor's Introduction

React Media Editor

React components library to edit Images and Video using canvas.

npm version contributions welcome License: MIT

logo

Description

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.

Installation

NPM package:

yarn i react-media-editor

Also you can modify project files directly, project built using RollupJS module bundler.

Example

To run example:

  • go to /example folder
  • yarn i
  • yarn start
  • open localhost:3000

Demo

You can review how to use ImageEditor on codesandbox:

Edit 5349lln724

Usage

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

Notice

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"
 />
...

ImageEditor and VideoEditor props

colorPicker - react-color component to enable color pick feature.

src - image or video source.

Main Technologies and libraries

More

If you would like to add comments to audio files please take a look on react-audio-comments library.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

Vlad Morzhanov

License

(The MIT License)

Copyright (c) 2018 Vlad Morzhanov. You can review license in the LICENSE file.

react-media-editor's People

Contributors

morzhanov avatar santosh898 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.