docs: update pluginOptions option, close #446

This commit is contained in:
DIYgod 2019-09-27 18:31:42 +08:00
parent 2d2f8fc96f
commit e7e3665526
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
4 changed files with 49 additions and 2 deletions

View File

@ -11,7 +11,6 @@
"node": true,
},
"rules": {
"no-console": 0,
"block-scoped-var": 1,
"curly": 1,
"eqeqeq": 1,
@ -24,7 +23,6 @@
"func-call-spacing": 1,
"keyword-spacing": 1,
"linebreak-style": 1,
"lines-around-comment": 1,
"no-multiple-empty-lines": 1,
"space-infix-ops": 1,
"arrow-spacing": 1,

View File

@ -2,6 +2,7 @@ language: node_js
node_js:
- lts/*
script:
- npm run build
- npm run docs:build
deploy:
provider: pages

View File

@ -489,7 +489,13 @@ const dp = new DPlayer({
url: 'demo.m3u8',
type: 'hls',
},
pluginOptions: {
hls: {
// hls config
},
},
});
console.log(dp.plugins.hls); // Hls instance
```
```js
@ -528,7 +534,13 @@ const dp = new DPlayer({
url: 'demo.mpd',
type: 'dash',
},
pluginOptions: {
dash: {
// dash config
},
},
});
console.log(dp.plugins.dash); // Dash instance
```
```js
@ -604,7 +616,13 @@ const dp = new DPlayer({
url: 'demo.flv',
type: 'flv',
},
pluginOptions: {
flv: {
// flv config
},
},
});
console.log(dp.plugins.flv); // flv instance
```
```js
@ -653,7 +671,13 @@ const dp = new DPlayer({
url: 'magnet:demo',
type: 'webtorrent',
},
pluginOptions: {
webtorrent: {
// webtorrent config
},
},
});
console.log(dp.plugins.webtorrent); // WebTorrent instance
```
```js

View File

@ -475,7 +475,13 @@ const dp = new DPlayer({
url: 'demo.m3u8',
type: 'hls',
},
pluginOptions: {
hls: {
// hls config
},
},
});
console.log(dp.plugins.hls); // Hls 实例
```
```js
@ -514,7 +520,13 @@ const dp = new DPlayer({
url: 'demo.mpd',
type: 'dash',
},
pluginOptions: {
dash: {
// dash config
},
},
});
console.log(dp.plugins.dash); // Dash 实例
```
```js
@ -590,7 +602,13 @@ const dp = new DPlayer({
url: 'demo.flv',
type: 'flv',
},
pluginOptions: {
flv: {
// flv config
},
},
});
console.log(dp.plugins.flv); // flv 实例
```
```js
@ -639,7 +657,13 @@ const dp = new DPlayer({
url: 'magnet:demo',
type: 'webtorrent',
},
pluginOptions: {
webtorrent: {
// webtorrent config
},
},
});
console.log(dp.plugins.webtorrent); // WebTorrent 实例
```
```js