Skip to content

Commit

Permalink
docs: update pluginOptions option, close #446
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Sep 27, 2019
1 parent 2d2f8fc commit e7e3665
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"node": true,
},
"rules": {
"no-console": 0,
"block-scoped-var": 1,
"curly": 1,
"eqeqeq": 1,
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: node_js
node_js:
- lts/*
script:
- npm run build
- npm run docs:build
deploy:
provider: pages
Expand Down
24 changes: 24 additions & 0 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions docs/zh/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,13 @@ const dp = new DPlayer({
url: 'demo.m3u8',
type: 'hls',
},
pluginOptions: {
hls: {
// hls config
},
},
});
console.log(dp.plugins.hls); // Hls 实例
```

```js
Expand Down Expand Up @@ -514,7 +520,13 @@ const dp = new DPlayer({
url: 'demo.mpd',
type: 'dash',
},
pluginOptions: {
dash: {
// dash config
},
},
});
console.log(dp.plugins.dash); // Dash 实例
```

```js
Expand Down Expand Up @@ -590,7 +602,13 @@ const dp = new DPlayer({
url: 'demo.flv',
type: 'flv',
},
pluginOptions: {
flv: {
// flv config
},
},
});
console.log(dp.plugins.flv); // flv 实例
```

```js
Expand Down Expand Up @@ -639,7 +657,13 @@ const dp = new DPlayer({
url: 'magnet:demo',
type: 'webtorrent',
},
pluginOptions: {
webtorrent: {
// webtorrent config
},
},
});
console.log(dp.plugins.webtorrent); // WebTorrent 实例
```

```js
Expand Down

0 comments on commit e7e3665

Please sign in to comment.