You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -11,35 +12,11 @@ View the [demo](http://mderrick.github.io/react-html5video/).
11
12
12
13
## Install
13
14
14
-
`npm install react-html5video --save` or `bower install react-html5video --save`
15
-
16
-
Include `dist/ReactHtml5Video.css` if you do not want to build your own CSS. Alternatively require `src/assets/video.css` if you want to compile the CSS yourself with [css-loaders](https://github.com/webpack/css-loader) and [url-loaders](https://github.com/webpack/url-loader) etc. See the demo [Webpack config](https://github.com/mderrick/react-html5video/blob/master/demo/webpack.config.js) as an example.
15
+
`npm install react-html5video --save`
17
16
18
17
### Peer Dependencies
19
18
20
-
This component uses ES2015 and needs to be transpiled using something like [babel-loader](https://github.com/babel/babel-loader). You will also need to either [polyfill](https://babeljs.io/docs/usage/polyfill/) or use [babel-runtime](https://www.npmjs.com/package/babel-runtime). It depends on:
21
-
-`react@>=0.14.x`
22
-
-`lodash.throttle@latest`.
23
-
24
-
### UMD
25
-
26
-
Alternatively if using the UMD module it is already transpiled to ES5 and `lodash.throttle` is included. You can find this build in the `dist` directory:
27
-
28
-
```js
29
-
// Includes lodash.throttle and is transpiled already. No ES2015 polyfill is required.
30
-
var Video =require('react-html5video/dist/ReactHtml5Video');
31
-
```
32
-
33
-
```js
34
-
// Exports to this global
35
-
var Video =window.ReactHtml5Video.default;
36
-
```
37
-
38
-
```js
39
-
// Requires es6 transpiling, an es6 polyfill/babel-runtime and all peer dependencies installed
@@ -49,6 +26,7 @@ Use normal HTML5 `<video>` markup with all the standard [html attributes](https:
49
26
50
27
```js
51
28
importVideofrom'react-html5video';
29
+
import'react-html5video/dist/styles.css';
52
30
render() {
53
31
return (
54
32
<Video controls autoPlay loop muted
@@ -64,10 +42,12 @@ render() {
64
42
65
43
### Advanced Usage
66
44
67
-
You can configure, customize and modify the controls by adding, removing and shuffling them as you desire. You can create your very own custom children components and controls that can interact with the video. All children components will receive [these props](#props-and-methods). Obviously you can still call methods and set properties on the HTML5 DOM element directly if you have access to it with `refs`:
45
+
You can configure, customize and modify the controls by adding, removing and shuffling them as you desire. You can create your very own custom children components and controls that can interact with the video. All children components will receive [these props](#props-and-methods). Obviously you can still call methods and set properties on the HTML5 DOM element directly if you have access to it with `refs`:
@@ -141,17 +121,14 @@ All children components receive the following methods via props:
141
121
142
122
### Dev Setup
143
123
144
-
To run a server with hot module replacement:
124
+
To run a development server with HMR:
145
125
146
126
```bash
147
-
$ npm install
148
-
$ cd demo
149
-
$ npm install
150
-
$ npm run dev-server
127
+
$ npm i
128
+
$ npm run i:demo
129
+
$ npm start
151
130
```
152
131
153
-
Open [http://localhost:8082](http://localhost:8082). You can now modify the files in both `src` and `demo/src`.
154
-
155
132
### Issues
156
133
157
134
Feel free to raise and solve any existing issues as desired. Where possible please do try and replicate any bugs you may have using the [react-html5video jsfiddle](https://jsfiddle.net/mderrick/7s9a311q/1/) and include them in your ticket.
0 commit comments