Open the project in Gitpod (free online dev environment for GitHub) and start coding immediately.
React component for Dplayer based on DPlayer(V1.26.0).
npm install react-dplayer -DimportDPlayerfrom"react-dplayer";classExampleextendsComponent{render(){return(<DPlayeroptions={{video:{url: 'http://static.smartisanos.cn/common/video/t1-ui.mp4'}}}/>)}}<scriptsrc="https://unpkg.com/dplayer/dist/DPlayer.min.js" /><scriptsrc="https://unpkg.com/react/dist/react.min.js" /><scriptsrc="https://unpkg.com/react-dom/dist/react-dom.min.js" /><scriptsrc="https://unpkg.com/react-dplayer/dist/react-dplayer.min.js" /><divid="example"></div><script>ReactDOM.render(React.createElement('div',{style: {width: 800,margin: '0px auto'}},React.createElement(ReactDPlayer,{options:{video: {url: 'http://static.smartisanos.cn/common/video/t1-ui.mp4'}}})),document.getElementById('example'));</script>The package also includes an in-built example under the /example folder. Run the sample application by cloning project and running npm start.
| Name | Type | Default | Description |
|---|---|---|---|
| options | Object | -- | read doc |
camel-case ruleexample play as onPlay
| Name | Params | Description |
|---|---|---|
| allEvent | default | read doc |
npm run start: Run example in development modenpm run compile: Build react-dplayer(commonjs)npm run dist: dist react-dplayer (umd)
react-dplayer is released under the MIT license.