├── .npmignore ├── .travis.yml ├── .babelrc ├── .gitignore ├── src ├── img │ ├── poster.png │ ├── video │ │ └── small.mp4 │ └── css │ │ ├── font │ │ ├── crop-video-set.eot │ │ ├── crop-video-set.ttf │ │ ├── crop-video-set.woff │ │ ├── crop-video-set.woff2 │ │ └── crop-video-set.svg │ │ └── custom.css ├── video │ └── small.mp4 ├── css │ ├── font │ │ ├── crop-video-set.eot │ │ ├── crop-video-set.ttf │ │ ├── crop-video-set.woff │ │ ├── crop-video-set.woff2 │ │ └── crop-video-set.svg │ └── custom.css ├── reducers │ ├── index.js │ └── crops.js ├── actions │ └── actionCreators.js ├── store.js ├── components │ ├── Spinner.js │ ├── Icon.js │ ├── Controls.js │ ├── ImageBtn.js │ ├── Crop.js │ ├── Play.js │ ├── Time.js │ ├── Overlay.js │ ├── Seek.js │ ├── ProgressBar.js │ ├── CropMarker.js │ └── Video.js └── RdxVideo.js ├── img └── crop-preview.png ├── index.html ├── server.js ├── webpack.config.js ├── package.json ├── README.md └── LICENSE.txt /.npmignore: -------------------------------------------------------------------------------- 1 | src -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "6" 4 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-0", "react"] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | build/ 3 | playground/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /src/img/poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/src/img/poster.png -------------------------------------------------------------------------------- /src/video/small.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/src/video/small.mp4 -------------------------------------------------------------------------------- /img/crop-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/img/crop-preview.png -------------------------------------------------------------------------------- /src/img/video/small.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/src/img/video/small.mp4 -------------------------------------------------------------------------------- /src/css/font/crop-video-set.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/src/css/font/crop-video-set.eot -------------------------------------------------------------------------------- /src/css/font/crop-video-set.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/src/css/font/crop-video-set.ttf -------------------------------------------------------------------------------- /src/css/font/crop-video-set.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/src/css/font/crop-video-set.woff -------------------------------------------------------------------------------- /src/css/font/crop-video-set.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/src/css/font/crop-video-set.woff2 -------------------------------------------------------------------------------- /src/img/css/font/crop-video-set.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/src/img/css/font/crop-video-set.eot -------------------------------------------------------------------------------- /src/img/css/font/crop-video-set.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/src/img/css/font/crop-video-set.ttf -------------------------------------------------------------------------------- /src/img/css/font/crop-video-set.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/src/img/css/font/crop-video-set.woff -------------------------------------------------------------------------------- /src/img/css/font/crop-video-set.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenity/react-html5-video-editor/HEAD/src/img/css/font/crop-video-set.woff2 -------------------------------------------------------------------------------- /src/reducers/index.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux'; 2 | 3 | import crops from './crops'; 4 | 5 | const rootReducer = combineReducers({crops,}); 6 | 7 | export default rootReducer; 8 | -------------------------------------------------------------------------------- /src/reducers/crops.js: -------------------------------------------------------------------------------- 1 | function crops(state = [], action) { 2 | switch(action.type) { 3 | case 'CROPS_CHANGED' : 4 | return [action.start ? action.start : state[0], action.end ? action.end : state[1]]; 5 | case 'IMG_INSERT' : 6 | console.log(state, action) 7 | state.push(action.position); 8 | return state 9 | default: 10 | return state; 11 | } 12 | } 13 | 14 | export default crops; 15 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | React HTML5 video editor 5 | 6 | 7 | 8 |
9 | 10 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | var WebpackDevServer = require('webpack-dev-server'); 3 | var config = require('./webpack.config'); 4 | 5 | new WebpackDevServer(webpack(config), { 6 | publicPath: config.output.publicPath, 7 | hot: true, 8 | historyApiFallback: true 9 | }).listen(3000, 'localhost', function (err, result) { 10 | if (err) { 11 | return console.log(err); 12 | } 13 | 14 | console.log('Listening at http://localhost:3000/'); 15 | }); 16 | -------------------------------------------------------------------------------- /src/actions/actionCreators.js: -------------------------------------------------------------------------------- 1 | // increment 2 | export function increment(index) { 3 | return { 4 | type: 'INCREMENT_LIKES', 5 | index 6 | } 7 | } 8 | 9 | // add comment 10 | export function addComment(postId, author, comment) { 11 | return { 12 | type: 'ADD_COMMENT', 13 | postId, 14 | author, 15 | comment 16 | } 17 | } 18 | 19 | // remove comment 20 | 21 | export function removeComment(postId, i) { 22 | return { 23 | type: 'REMOVE_COMMENT', 24 | i, 25 | postId 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/store.js: -------------------------------------------------------------------------------- 1 | import { createStore, compose } from 'redux'; 2 | 3 | import rootReducer from './reducers/index'; 4 | 5 | const defaultState = { 6 | crops: [0, 100], 7 | }; 8 | 9 | const store = createStore(rootReducer, defaultState, compose( 10 | window.devToolsExtension ? window.devToolsExtension() : f => f 11 | )); 12 | 13 | if(module.hot) { 14 | module.hot.accept('./reducers/',() => { 15 | const nextRootReducer = require('./reducers/index').default; 16 | store.replaceReducer(nextRootReducer); 17 | }); 18 | } 19 | 20 | export default store; 21 | -------------------------------------------------------------------------------- /src/components/Spinner.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | 3 | var Spinner = React.createClass({ 4 | 5 | render() { 6 | return ( 7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | ); 15 | } 16 | 17 | }); 18 | 19 | export default Spinner; -------------------------------------------------------------------------------- /src/components/Icon.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | 3 | var Icon = React.createClass({ 4 | 5 | propTypes: { 6 | name: React.PropTypes.oneOf([ 7 | 'play-1', 8 | 'volume-off', 9 | 'volume-down', 10 | 'volume-up', 11 | 'resize-full', 12 | 'resize-small', 13 | 'pause-1', 14 | 'crop', 15 | 'crop-begin', 16 | 'crop-end', 17 | ]) 18 | }, 19 | 20 | render() { 21 | return ( 22 | 23 | ); 24 | } 25 | 26 | }); 27 | 28 | export default Icon; -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var webpack = require('webpack'); 3 | 4 | module.exports = { 5 | devtool: 'eval', 6 | entry: [ 7 | // 'webpack-dev-server/client?http://localhost:3000', 8 | // 'webpack/hot/only-dev-server', 9 | './src/RdxVideo' 10 | ], 11 | output: { 12 | path: path.join(__dirname, 'dist'), 13 | filename: 'react-html5-video-editor.js', 14 | // libraryTarget: 'umd', 15 | library: 'ReactHtml5VideoEditor', 16 | publicPath: '/static/' 17 | }, 18 | // plugins: [ 19 | // new webpack.HotModuleReplacementPlugin() 20 | // ], 21 | module: { 22 | loaders: [{ 23 | test: /\.js$/, 24 | loaders: ['babel'], 25 | include: path.join(__dirname, 'src') 26 | }] 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /src/components/Controls.js: -------------------------------------------------------------------------------- 1 | import {default as Time} from './Time' 2 | import {default as Play} from './Play' 3 | import {default as Seek} from './Seek' 4 | 5 | 6 | var React = require('react'); 7 | 8 | var Controls = React.createClass({ 9 | getInitialState: function() { 10 | return { 11 | }; 12 | }, 13 | 14 | 15 | render: function() { 16 | var children = [ 17 | , 18 | , 19 |