Browse Source

docs: update options

DIYgod 2 years ago
parent
commit
0634b3df99
3 changed files with 12 additions and 3 deletions
  1. 4 1
      demo/demo.js
  2. 4 1
      docs/guide.md
  3. 4 1
      docs/zh/guide.md

+ 4 - 1
demo/demo.js

@@ -83,6 +83,7 @@ function initPlayers() {
         loop: true,
         screenshot: true,
         airplay: true,
+        chromecast: true,
         hotkey: true,
         logo: 'https://i.loli.net/2019/06/06/5cf8c5d94521136430.png',
         volume: 0.2,
@@ -103,11 +104,13 @@ function initPlayers() {
         danmaku: {
             id: '9E2E3368B56CDBB4',
             api: 'https://api.prprpr.me/dplayer/',
+            addition: ['https://s-sh-17-dplayercdn.oss.dogecdn.com/1678963.json'],
             token: 'tokendemo',
             maximum: 3000,
             user: 'DIYgod',
             bottom: '15%',
-            unlimited: true
+            unlimited: true,
+            speedRate: 0.5,
         },
         contextmenu: [
             {

+ 4 - 1
docs/guide.md

@@ -91,7 +91,8 @@ You can custom your player instance by those options
 | loop                 | false                              | video loop                                                                                                                                                 |
 | lang                 | navigator.language.toLowerCase()   | values: 'en', 'zh-cn', 'zh-tw'                                                                                                                             |
 | screenshot           | false                              | enable screenshot, if true, video and video poster must enable Cross-Origin                                                                                |
-| airplay              | true                               | enable airplay in Safari                                                                                                                                   |
+| airplay              | false                              | enable airplay in Safari                                                                                                                                   |
+| chromecast           | false                              | enable Chromecast                                                                                                                                          |
 | hotkey               | true                               | enable hotkey, support FF, FR, volume control, play & pause                                                                                                |
 | preload              | 'auto'                             | values: 'none', 'metadata', 'auto'                                                                                                                         |
 | volume               | 0.7                                | default volume, notice that player will remember user setting, default volume will not work after user set volume themselves                               |
@@ -121,6 +122,7 @@ You can custom your player instance by those options
 | danmaku.user         | 'DIYgod'                           | danmaku user name                                                                                                                                          |
 | danmaku.bottom       | -                                  | values like: '10px' '10%', the distance between the danmaku bottom and player bottom, in order to prevent warding off subtitle                             |
 | danmaku.unlimited    | false                              | display all danmaku even though danmaku overlap, notice that player will remember user setting, default setting will not work after user set it themselves |
+| danmaku.speedRate    | 1                                  | danmaku speed multiplier, the larger the faster                                                                                                            |
 | contextmenu          | []                                 | custom contextmenu                                                                                                                                         |
 | highlight            | []                                 | custom time markers upon progress bar                                                                                                                      |
 | mutex                | true                               | prevent to play multiple player at the same time, pause other players when this player start play                                                          |
@@ -160,6 +162,7 @@ const dp = new DPlayer({
         user: 'DIYgod',
         bottom: '15%',
         unlimited: true,
+        speedRate: 0.5,
     },
     contextmenu: [
         {

+ 4 - 1
docs/zh/guide.md

@@ -82,7 +82,8 @@ DPlayer 有丰富的参数可以自定义你的播放器实例
 | lang                 | navigator.language.toLowerCase()   | 可选值: 'en', 'zh-cn', 'zh-tw'                                                                          |
 | screenshot           | false                              | 开启截图,如果开启,视频和视频封面需要允许跨域                                                          |
 | hotkey               | true                               | 开启热键,支持快进、快退、音量控制、播放暂停                                                            |
-| airplay              | true                               | 在 Safari 中开启 AirPlay                                                                                |
+| airplay              | false                              | 在 Safari 中开启 AirPlay                                                                                |
+| chromecast           | false                              | 启用 Chromecast                                                                                         |
 | preload              | 'auto'                             | 视频预加载,可选值: 'none', 'metadata', 'auto'                                                          |
 | volume               | 0.7                                | 默认音量,请注意播放器会记忆用户设置,用户手动设置音量后默认音量即失效                                  |
 | playbackSpeed        | [0.5, 0.75, 1, 1.25, 1.5, 2]       | 可选的播放速率,可以设置成自定义的数组                                                                  |
@@ -111,6 +112,7 @@ DPlayer 有丰富的参数可以自定义你的播放器实例
 | danmaku.user         | 'DIYgod'                           | 弹幕用户名                                                                                              |
 | danmaku.bottom       | -                                  | 弹幕距离播放器底部的距离,防止遮挡字幕,取值形如: '10px' '10%'                                          |
 | danmaku.unlimited    | false                              | 海量弹幕模式,即使重叠也展示全部弹幕,请注意播放器会记忆用户设置,用户手动设置后即失效                  |
+| danmaku.speedRate    | 1                                  | 弹幕速度倍率,越大速度越快                                                                              |
 | contextmenu          | []                                 | 自定义右键菜单                                                                                          |
 | highlight            | []                                 | 自定义进度条提示点                                                                                      |
 | mutex                | true                               | 互斥,阻止多个播放器同时播放,当前播放器播放时暂停其他播放器                                            |
@@ -150,6 +152,7 @@ const dp = new DPlayer({
         user: 'DIYgod',
         bottom: '15%',
         unlimited: true,
+        speedRate: 0.5,
     },
     contextmenu: [
         {