• This repository has been archived on 02/Dec/2020
  • Stars
    star
    150
  • Rank 246,559 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 7 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

react-dplayer

Build Status Version NPM LICENSE

react-dplayer demo next demo

Gitpod

Open the project in Gitpod (free online dev environment for GitHub) and start coding immediately.

Open in Gitpod

React component for Dplayer based on DPlayer(V1.26.0).

Install

npm install react-dplayer -D

Usage

commonjs

import DPlayer from "react-dplayer";

class Example extends Component {
    render() {
        return (
            <DPlayer
                options={{
                    video:{url: 'http://static.smartisanos.cn/common/video/t1-ui.mp4'}
                }}
                />
        )
    }
}

browser

<script src="https://unpkg.com/dplayer/dist/DPlayer.min.js" />
<script src="https://unpkg.com/react/dist/react.min.js" />
<script src="https://unpkg.com/react-dom/dist/react-dom.min.js" />
<script src="https://unpkg.com/react-dplayer/dist/react-dplayer.min.js" />
<div id="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.

Dplayer Doc

Props

Name Type Default Description
options Object -- read doc

Events

camel-case rule example play as onPlay

Name Params Description
allEvent default read doc

Development

  • npm run start: Run example in development mode
  • npm run compile: Build react-dplayer(commonjs)
  • npm run dist: dist react-dplayer (umd)

License

react-dplayer is released under the MIT license.

More Repositories

1

hexo-tag-aplayer

Embed aplayer in Hexo posts/pages
JavaScript
702
star
2

cPlayer

A beautiful and clean WEB Music Player by HTML5.
CSS
667
star
3

vue-dplayer

📹 A Vue 2.x video player component based on DPlayer
Vue
620
star
4

APlayer-Typecho

在线音乐播放器插件 for typecho 1.0
PHP
486
star
5

vue-aplayer

🍰 A beautiful HTML5 music player for Vue.js
TypeScript
462
star
6

Hermit-X

在 WordPress 中使用 APlayer 播放音乐吧~
JavaScript
289
star
7

hexo-tag-dplayer

Embed dplayer in Hexo posts/pages
JavaScript
207
star
8

DPlayer-Typecho

Typecho plugin for DPlayer
PHP
191
star
9

DPlayer-node

Node.js backend with Docker for DPlayer(https://github.com/DIYgod/DPlayer)
JavaScript
164
star
10

DPlayer-WordPress

DPlayer for WordPress
PHP
69
star
11

DPlayer-thumbnails

Generate thumbnails for DPlayer
JavaScript
63
star
12

react-aplayer

🍭 A React wrapper component of APlayer
JavaScript
39
star
13

laravel-danmaku

DPlayer Danmaku
PHP
29
star
14

angular-moeplayer

An Angular 6.x video player component based on DPlayer
TypeScript
29
star
15

DPlayer-data

DPlayer damaku data daily backup
Shell
19
star
16

Caraoke

Web Karaoke Loader,shows karaoke lyrics in web pages.
TypeScript
11
star
17

DPlayer_for_Z-BlogPHP

Z-BlogPHP plugin for DPlayer https://www.fghrsh.net/post/57.html
PHP
9
star
18

APlayer_for_Z-BlogPHP

Z-BlogPHP plugin for APlayer https://www.fghrsh.net/post/77.html
PHP
8
star
19

DPlayer-API

DPlayer API For PHP
PHP
8
star
20

DPlayer-Chrome

Replace stupid players with DPlayer
7
star
21

RailsGun

🔫 Dplayer backend for rails 弹幕军火库。姬~~。。 超电磁炮!!!
Ruby
6
star
22

MoePlayer.github.io

Homepage for MoePlayer
HTML
5
star