diff --git a/README.md b/README.md
index 8dd0369..ba8c8f0 100644
--- a/README.md
+++ b/README.md
@@ -46,10 +46,16 @@ Using DPlayer on your project? [Let me know!](https://github.com/DIYgod/DPlayer/
## Thanks
+## Special Sponsors
+
+
+
+
+
### Sponsors
-
-
+
+
diff --git a/docs/README.md b/docs/README.md
index 8d438d6..3999de1 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -8,8 +8,14 @@ search: english
## Special Sponsors
-
-
+
+
+
+
+## Sponsors
+
+
+
@@ -63,8 +69,8 @@ const dp = new DPlayer({
Work with module bundler:
```js
-import 'DPlayer/dist/DPlayer.min.css';
-import DPlayer from 'DPlayer';
+import 'dplayer/dist/DPlayer.min.css';
+import DPlayer from 'dplayer';
const dp = new DPlayer(options);
```
@@ -345,6 +351,8 @@ Player events
- resize
- fullscreen
- fullscreen_cancel
+- webfullscreen
+- webfullscreen_cancel
- subtitle_show
- subtitle_hide
- subtitle_change
diff --git a/docs/config.js b/docs/config.js
index f376d92..39806b2 100644
--- a/docs/config.js
+++ b/docs/config.js
@@ -83,8 +83,8 @@ function dplayer1 () {
container: document.getElementById('dplayer1'),
video: {
url: 'https://api.dogecloud.com/player/get.mp4?vcode=5ac682e6f8231991&userId=17&ext=.mp4',
- pic: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.png',
- thumbnails: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara_thumbnails.jpg'
+ pic: 'https://cn-east-17-dplayer-86110920.oss.dogecdn.com/hikarunara.png',
+ thumbnails: 'https://cn-east-17-dplayer-86110920.oss.dogecdn.com/hikarunara_thumbnails.jpg'
},
danmaku: {
id: '9E2E3368B56CDBB4',
@@ -96,14 +96,10 @@ function dplayer1 () {
function dplayer2 () {
window.dp2 = new DPlayer({
container: document.getElementById('dplayer2'),
- screenshot: true,
video: {
- url: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.mp4',
- pic: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.png',
- thumbnails: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara_thumbnails.jpg'
- },
- subtitle: {
- url: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.vtt'
+ url: 'https://api.dogecloud.com/player/get.mp4?vcode=5ac682e6f8231991&userId=17&ext=.mp4',
+ pic: 'https://cn-east-17-dplayer-86110920.oss.dogecdn.com/hikarunara.png',
+ thumbnails: 'https://cn-east-17-dplayer-86110920.oss.dogecdn.com/hikarunara_thumbnails.jpg'
},
danmaku: {
id: '9E2E3368B56CDBB4',
@@ -119,25 +115,17 @@ function dplayer3 () {
theme: '#FADFA3',
loop: true,
lang: 'zh-cn',
- screenshot: true,
hotkey: true,
preload: 'auto',
- logo: 'https://moeplayer.b0.upaiyun.com/dplayer/DPlayer.png',
+ logo: 'https://cn-east-17-dplayer-86110920.oss.dogecdn.com/DPlayer.png',
volume: 0.7,
mutex: true,
video: {
- url: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.mp4',
- pic: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.png',
- thumbnails: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara_thumbnails.jpg',
+ url: 'https://api.dogecloud.com/player/get.mp4?vcode=5ac682e6f8231991&userId=17&ext=.mp4',
+ pic: 'https://cn-east-17-dplayer-86110920.oss.dogecdn.com/hikarunara.png',
+ thumbnails: 'https://cn-east-17-dplayer-86110920.oss.dogecdn.com/hikarunara_thumbnails.jpg',
type: 'auto'
},
- subtitle: {
- url: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.vtt',
- type: 'webvtt',
- fontSize: '25px',
- bottom: '10%',
- color: '#b7daff'
- },
danmaku: {
id: '9E2E3368B56CDBB4',
api: 'https://api.prprpr.me/dplayer/',
@@ -179,16 +167,16 @@ function dplayer4 () {
video: {
quality: [{
name: 'HD',
- url: 'https://moeplayer.b0.upaiyun.com/dplayer/hls/hikarunara.m3u8',
+ url: 'https://api.dogecloud.com/player/get.m3u8?vcode=5ac682e6f8231991&userId=17&ext=.m3u8',
type: 'hls'
}, {
name: 'SD',
- url: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.mp4',
+ url: 'https://api.dogecloud.com/player/get.mp4?vcode=5ac682e6f8231991&userId=17&ext=.mp4',
type: 'normal'
}],
defaultQuality: 0,
- pic: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.png',
- thumbnails: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara_thumbnails.jpg'
+ pic: 'https://cn-east-17-dplayer-86110920.oss.dogecdn.com/hikarunara.png',
+ thumbnails: 'https://cn-east-17-dplayer-86110920.oss.dogecdn.com/hikarunara_thumbnails.jpg'
}
});
}
@@ -197,27 +185,27 @@ function dplayer5 () {
window.dp5 = new DPlayer({
container: document.getElementById('dplayer5'),
video: {
- url: 'https://moeplayer.b0.upaiyun.com/dplayer/hls/hikarunara.m3u8',
+ url: 'https://api.dogecloud.com/player/get.m3u8?vcode=5ac682e6f8231991&userId=17&ext=.m3u8',
type: 'hls'
}
});
}
function dplayer6 () {
- window.dp6 = new DPlayer({
- container: document.getElementById('dplayer6'),
- video: {
- url: 'https://moeplayer.b0.upaiyun.com/dplayer/dash/hikarunara.mpd',
- type: 'dash'
- }
- });
+ // window.dp6 = new DPlayer({
+ // container: document.getElementById('dplayer6'),
+ // video: {
+ // url: 'https://moeplayer.b0.upaiyun.com/dplayer/dash/hikarunara.mpd',
+ // type: 'dash'
+ // }
+ // });
}
function dplayer7 () {
window.dp7 = new DPlayer({
container: document.getElementById('dplayer7'),
video: {
- url: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.flv',
+ url: 'https://api.dogecloud.com/player/get.flv?vcode=5ac682e6f8231991&userId=17&ext=.flv',
type: 'flv'
}
});
@@ -249,7 +237,7 @@ function dplayer9 () {
}
},
video: {
- url: 'https://moeplayer.b0.upaiyun.com/dplayer/hls/hikarunara.m3u8',
+ url: 'https://api.dogecloud.com/player/get.m3u8?vcode=5ac682e6f8231991&userId=17&ext=.m3u8',
type: 'hls'
}
});
diff --git a/docs/support.md b/docs/support.md
index 0ea7455..3bdba86 100644
--- a/docs/support.md
+++ b/docs/support.md
@@ -30,10 +30,16 @@ Recurring pledges come with exclusive perks, e.g. having your name or your compa
## Current Premium Sponsors
-### Special Sponsors
+## Special Sponsors
-
-
+
+
+
+
+### Sponsors
+
+
+
diff --git a/docs/zh-Hans/README.md b/docs/zh-Hans/README.md
index a125dd8..cdbb449 100644
--- a/docs/zh-Hans/README.md
+++ b/docs/zh-Hans/README.md
@@ -9,8 +9,8 @@ search: zh-Hans
## 特别赞助商
-
-
+
+
@@ -64,8 +64,8 @@ const dp = new DPlayer({
使用模块管理器:
```js
-import 'DPlayer/dist/DPlayer.min.css';
-import DPlayer from 'DPlayer';
+import 'dplayer/dist/DPlayer.min.css';
+import DPlayer from 'dplayer';
const dp = new DPlayer(options);
```
diff --git a/docs/zh-Hans/support.md b/docs/zh-Hans/support.md
index 786fe00..bd97c7b 100644
--- a/docs/zh-Hans/support.md
+++ b/docs/zh-Hans/support.md
@@ -33,8 +33,8 @@ DPlayer 是采用 MIT 许可的开源项目,使用完全免费。 但是随着
### 特别赞助商
-
-
+
+
diff --git a/package.json b/package.json
index 58c096f..a1b1dc2 100644
--- a/package.json
+++ b/package.json
@@ -43,6 +43,7 @@
"exports-loader": "^0.7.0",
"file-loader": "^1.1.11",
"git-revision-webpack-plugin": "^3.0.3",
+ "mini-css-extract-plugin": "0.4.0",
"node-sass": "^4.9.0",
"postcss-loader": "^2.1.5",
"sass-loader": "^7.0.3",
@@ -52,13 +53,12 @@
"template-string-optimize-loader": "^2.2.3",
"url-loader": "^1.0.1",
"webpack": "^4.12.0",
+ "webpack-cli": "3.0.4",
"webpack-dev-server": "^3.1.4"
},
"dependencies": {
"axios": "0.18.0",
"balloon-css": "^0.5.0",
- "mini-css-extract-plugin": "0.4.0",
- "promise-polyfill": "8.0.0",
- "webpack-cli": "3.0.4"
+ "promise-polyfill": "8.0.0"
}
}
diff --git a/src/js/player.js b/src/js/player.js
index 4383f35..312c710 100644
--- a/src/js/player.js
+++ b/src/js/player.js
@@ -495,6 +495,7 @@ class DPlayer {
}
switchQuality (index) {
+ index = typeof index === 'string' ? parseInt(index) : index;
if (this.qualityIndex === index || this.switchingQuality) {
return;
}