2017-07-23 14:13:11 +00:00
|
|
|
|
<p align="center">
|
|
|
|
|
<img src="https://ws4.sinaimg.cn/large/006tKfTcgy1fhu01y9uy7j305k04s3yc.jpg" alt="ADPlayer" width="100">
|
|
|
|
|
</p>
|
|
|
|
|
<h1 align="center">DPlayer</h1>
|
2016-05-03 14:11:47 +00:00
|
|
|
|
|
2017-07-23 14:17:16 +00:00
|
|
|
|
> Wow, such a lovely HTML5 danmaku video player
|
|
|
|
|
|
2016-05-03 14:11:47 +00:00
|
|
|
|
[![npm](https://img.shields.io/npm/v/dplayer.svg?style=flat-square)](https://www.npmjs.com/package/dplayer)
|
2017-07-27 17:30:38 +00:00
|
|
|
|
[![npm](https://img.shields.io/npm/l/dplayer.svg?style=flat-square)](https://github.com/MoePlayer/DPlayer/blob/master/LICENSE)
|
2016-05-03 14:11:47 +00:00
|
|
|
|
[![npm](https://img.shields.io/npm/dt/dplayer.svg?style=flat-square)](https://www.npmjs.com/package/dplayer)
|
2017-08-03 09:50:09 +00:00
|
|
|
|
[![size](https://badge-size.herokuapp.com/MoePlayer/DPlayer/master/dist/DPlayer.min.js?compression=gzip&style=flat-square)](https://github.com/MoePlayer/DPlayer/tree/master/dist)
|
2017-07-27 17:30:38 +00:00
|
|
|
|
[![Travis](https://img.shields.io/travis/MoePlayer/DPlayer.svg?style=flat-square)](https://travis-ci.org/MoePlayer/DPlayer)
|
2017-08-03 09:50:09 +00:00
|
|
|
|
[![devDependency Status](https://img.shields.io/david/dev/MoePlayer/dplayer.svg?style=flat-square)](https://david-dm.org/MoePlayer/DPlayer#info=devDependencies)
|
2017-07-27 17:30:38 +00:00
|
|
|
|
[![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?style=flat-square)](https://github.com/MoePlayer/DPlayer#donate)
|
2016-05-03 14:11:47 +00:00
|
|
|
|
|
|
|
|
|
## Introduction
|
|
|
|
|
|
2017-07-23 14:17:16 +00:00
|
|
|
|
![image](http://i.imgur.com/207ch36.jpg)
|
|
|
|
|
|
|
|
|
|
DPlayer is a lovely HTML5 danmaku video player to help people build video and danmaku easily.
|
2016-05-19 14:49:13 +00:00
|
|
|
|
|
2017-07-23 14:13:11 +00:00
|
|
|
|
**DPlayer supports:**
|
|
|
|
|
|
2017-07-23 14:17:16 +00:00
|
|
|
|
- Streaming formats
|
2017-07-23 14:13:11 +00:00
|
|
|
|
- [HLS](https://github.com/video-dev/hls.js)
|
|
|
|
|
- [FLV](https://github.com/Bilibili/flv.js)
|
2017-12-11 10:16:51 +00:00
|
|
|
|
- [MPEG DASH](https://github.com/Dash-Industry-Forum/dash.js)
|
2018-01-19 09:30:35 +00:00
|
|
|
|
- [WebTorrent](https://github.com/webtorrent/webtorrent)
|
2017-07-23 14:17:16 +00:00
|
|
|
|
- Media formats
|
2017-07-23 14:13:11 +00:00
|
|
|
|
- MP4 H.264
|
|
|
|
|
- WebM
|
2017-07-23 15:08:10 +00:00
|
|
|
|
- Ogg Theora Vorbis
|
2017-07-23 14:17:16 +00:00
|
|
|
|
- Features
|
2017-07-23 14:13:11 +00:00
|
|
|
|
- Danamku
|
|
|
|
|
- Screenshot
|
|
|
|
|
- Hotkeys
|
|
|
|
|
- Quality switching
|
2017-08-31 18:51:22 +00:00
|
|
|
|
- Thumbnails
|
2017-09-23 13:04:49 +00:00
|
|
|
|
- Subtitle
|
2016-11-28 04:28:51 +00:00
|
|
|
|
|
2016-10-17 03:15:10 +00:00
|
|
|
|
Using DPlayer on your project? [Let me know!](https://github.com/DIYgod/DPlayer/issues/31)
|
2016-10-17 03:14:21 +00:00
|
|
|
|
|
2017-07-23 14:13:11 +00:00
|
|
|
|
**[Demo](http://dplayer.js.org/)**
|
|
|
|
|
|
|
|
|
|
**[Docs](http://dplayer.js.org/docs)**
|
|
|
|
|
|
2016-05-03 14:11:47 +00:00
|
|
|
|
## Install
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ npm install dplayer --save
|
2016-05-03 14:14:11 +00:00
|
|
|
|
```
|
2016-05-03 14:11:47 +00:00
|
|
|
|
|
2017-06-18 18:44:56 +00:00
|
|
|
|
## Quick Start
|
|
|
|
|
|
2017-07-23 14:13:11 +00:00
|
|
|
|
```html
|
2017-07-23 14:21:04 +00:00
|
|
|
|
<link rel="stylesheet" href="dist/DPlayer.min.css">
|
2017-07-23 14:13:11 +00:00
|
|
|
|
<div id="player1"></div>
|
2017-07-23 14:21:04 +00:00
|
|
|
|
<script src="dist/DPlayer.min.js"></script>
|
2017-07-23 14:13:11 +00:00
|
|
|
|
```
|
|
|
|
|
|
2017-06-18 18:44:56 +00:00
|
|
|
|
```js
|
|
|
|
|
var dp = new DPlayer({
|
|
|
|
|
element: document.getElementById('player1'),
|
|
|
|
|
video: {
|
|
|
|
|
url: 'dplayer.mp4',
|
|
|
|
|
pic: 'dplayer.png'
|
|
|
|
|
},
|
|
|
|
|
danmaku: {
|
|
|
|
|
id: 'testid',
|
|
|
|
|
api: 'https://api.prprpr.me/dplayer/'
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
```
|
|
|
|
|
|
2016-11-28 07:02:19 +00:00
|
|
|
|
## Usage
|
|
|
|
|
|
2017-07-23 14:21:04 +00:00
|
|
|
|
[Read the Docs](http://dplayer.js.org/docs)
|
2016-11-28 07:02:19 +00:00
|
|
|
|
|
2018-01-10 09:27:00 +00:00
|
|
|
|
## FAQ
|
|
|
|
|
|
|
|
|
|
<details><summary>Why can't some videos be full screen?</summary><br>
|
|
|
|
|
|
|
|
|
|
If player is contained in a iframe, try adding the allowfullscreen attribute to the iframe.
|
|
|
|
|
|
|
|
|
|
For full browser support it should look like this:
|
|
|
|
|
|
|
|
|
|
```html
|
|
|
|
|
<iframe src="example.com"
|
|
|
|
|
allowfullscreen="allowfullscreen"
|
|
|
|
|
mozallowfullscreen="mozallowfullscreen"
|
|
|
|
|
msallowfullscreen="msallowfullscreen"
|
|
|
|
|
oallowfullscreen="oallowfullscreen"
|
|
|
|
|
webkitallowfullscreen="webkitallowfullscreen"></iframe>
|
|
|
|
|
```
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
<details><summary>Why can't player autoplay in some mobile browsers?</summary><br>
|
|
|
|
|
|
|
|
|
|
Most mobile browsers forbid video autoplay, you wont be able to achieve it without hacks.
|
|
|
|
|
</details>
|
|
|
|
|
|
2017-07-23 14:13:11 +00:00
|
|
|
|
## Join the Discussion
|
2017-04-12 13:52:18 +00:00
|
|
|
|
|
2017-07-23 14:13:11 +00:00
|
|
|
|
- [Telegram Group](https://t.me/adplayer)
|
|
|
|
|
- [QQ Group](https://shang.qq.com/wpa/qunwpa?idkey=bf22213ae0028a82e5adf3f286dfd4f01e0997dc9f1dcd8e831a0a85e799be17): 415835947
|
2017-04-12 13:52:18 +00:00
|
|
|
|
|
2016-05-13 00:43:39 +00:00
|
|
|
|
## Related Projects
|
|
|
|
|
|
2017-07-27 17:30:38 +00:00
|
|
|
|
- [DPlayer-backend](https://github.com/MoePlayer/DPlayer-backend)
|
|
|
|
|
- [DPlayer-data(weekly backup for api.prprpr.me/dplayer)](https://github.com/MoePlayer/DPlayer-data)
|
2017-09-02 05:26:13 +00:00
|
|
|
|
- [DPlayer-thumbnails](https://github.com/MoePlayer/DPlayer-thumbnails)
|
2016-05-13 00:43:39 +00:00
|
|
|
|
- [DPlayer-for-typecho](https://github.com/volio/DPlayer-for-typecho)
|
2016-05-23 16:20:43 +00:00
|
|
|
|
- [Hexo-tag-dplayer](https://github.com/NextMoe/hexo-tag-dplayer)
|
2016-06-01 15:05:13 +00:00
|
|
|
|
- [DPlayer_for_Z-BlogPHP](https://github.com/fghrsh/DPlayer_for_Z-BlogPHP)
|
2016-08-24 03:02:31 +00:00
|
|
|
|
- [纸飞机视频区插件(DPlayer for Discuz!)](https://coding.net/u/Click_04/p/video/git)
|
2016-09-08 17:17:24 +00:00
|
|
|
|
- [dplayer_py_backend](https://github.com/dixyes/dplayer_py_backend)
|
|
|
|
|
- [dplayer_lua_backend](https://github.com/dixyes/dplayer_lua_backend)
|
2016-09-19 01:51:56 +00:00
|
|
|
|
- [DPlayer for WordPress](https://github.com/BlueCocoa/DPlayer-WordPress)
|
2017-04-07 03:37:29 +00:00
|
|
|
|
- [Vue-DPlayer](https://github.com/sinchang/vue-dplayer)
|
2017-08-21 16:15:07 +00:00
|
|
|
|
- [react-dplayer](https://github.com/hnsylitao/react-dplayer)
|
2017-12-15 11:07:01 +00:00
|
|
|
|
- [DPlayer-Lite](https://github.com/kn007/DPlayer-Lite)
|
|
|
|
|
- [DPlayerHandle](https://github.com/kn007/DPlayerHandle)
|
2017-07-27 17:30:38 +00:00
|
|
|
|
- Feel free to submit yours in [`Let me know!`](https://github.com/MoePlayer/DPlayer/issues/31)
|
2017-07-23 14:13:11 +00:00
|
|
|
|
|
|
|
|
|
## Who use DPlayer?
|
|
|
|
|
|
2017-12-15 11:07:01 +00:00
|
|
|
|
- [Hi, DIYgod](https://diygod.me)
|
2017-07-23 14:13:11 +00:00
|
|
|
|
- [嘀哩嘀哩](http://www.dilidili.wang/)
|
|
|
|
|
- [0xBBC](https://blog.0xbbc.com/2016/09/dplayer-for-wordpress/)
|
|
|
|
|
- [树洞](https://aoaoao.me/1031.html)
|
|
|
|
|
- [FGHRSH的博客](https://www.fghrsh.net/post/57.html)
|
|
|
|
|
- [银色子弹](https://www.sbsub.com/)
|
|
|
|
|
- [妖气山弹幕网](http://www.m173.tv/)
|
|
|
|
|
- [御宅同萌 – 聖域](https://wp.acg-moe.com/)
|
2017-07-23 15:08:10 +00:00
|
|
|
|
- [纸飞机南航青年网络社区](http://my.nuaa.edu.cn/video-video.html)
|
2017-07-25 18:21:42 +00:00
|
|
|
|
- [otomads](https://otomads.com/)
|
2017-09-05 17:50:10 +00:00
|
|
|
|
- [JA 日本動漫交流平台Ω](http://jac-animation-net.blogspot.tw/)
|
|
|
|
|
- [九妖萌弹幕动漫网](http://www.91moe.com/)
|
|
|
|
|
- [爱弹幕](https://www.idanmu.pw/)
|
|
|
|
|
- [萌心次元](https://moxacg.moe/)
|
2017-12-15 11:07:01 +00:00
|
|
|
|
- [kn007的个人博客](https://kn007.net/)
|
2017-07-27 17:30:38 +00:00
|
|
|
|
- Feel free to submit yours in [`Let me know!`](https://github.com/MoePlayer/DPlayer/issues/31)
|
2017-07-23 14:13:11 +00:00
|
|
|
|
|
|
|
|
|
## CDN
|
|
|
|
|
|
2017-09-13 17:50:08 +00:00
|
|
|
|
- [jsDelivr](https://www.jsdelivr.com/package/npm/dplayer)
|
2017-07-23 14:21:04 +00:00
|
|
|
|
- [cdnjs](https://cdnjs.com/libraries/dplayer)
|
2017-09-13 17:50:08 +00:00
|
|
|
|
- [unpkg](https://unpkg.com/dplayer/dist/)
|
2017-07-27 17:30:38 +00:00
|
|
|
|
- [RawGit](https://rawgit.com/MoePlayer/DPlayer/master/dist/DPlayer.min.js)
|
2017-07-23 14:13:11 +00:00
|
|
|
|
|
|
|
|
|
## Donate
|
|
|
|
|
|
|
|
|
|
- [Donate via Paypal](https://www.paypal.me/DIYgod)
|
|
|
|
|
- [Donate via WeChat Pay](https://ws4.sinaimg.cn/large/006tKfTcgy1fhu1uowywej307s07st8h.jpg)
|
|
|
|
|
- [Donate via Alipay](https://ws4.sinaimg.cn/large/006tKfTcgy1fhu1vf4ih7j307s07sdfm.jpg)
|
|
|
|
|
- Donate via Bitcoin: 13CwQLHzPYm2tewNMSJBeArbbRM5NSmCD1
|
|
|
|
|
|
2017-09-28 18:02:39 +00:00
|
|
|
|
## Sponsor
|
|
|
|
|
|
|
|
|
|
- The CDN service is sponsored by [又拍云](https://console.upyun.com/register/?invite=BkLZ2Xqob)
|
|
|
|
|
|
2017-07-23 14:13:11 +00:00
|
|
|
|
## Author
|
2017-04-07 03:37:29 +00:00
|
|
|
|
|
2017-07-23 14:13:11 +00:00
|
|
|
|
**DPlayer** © [DIYgod](https://github.com/DIYgod), Released under the [MIT](./LICENSE) License.<br>
|
|
|
|
|
Authored and maintained by DIYgod with help from contributors ([list](https://github.com/DIYgod/DPlayer/contributors)).
|
2016-05-03 14:11:47 +00:00
|
|
|
|
|
2017-12-21 16:44:30 +00:00
|
|
|
|
> [Blog](https://diygod.me) · GitHub [@DIYgod](https://github.com/DIYgod) · Twitter [@DIYgod](https://twitter.com/DIYgod) · Telegram Channel [@awesomeDIYgod](https://t.me/awesomeDIYgod)
|