From e7e3665526f51012bb356ad1abc3d68e127ad6d1 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 27 Sep 2019 18:31:42 +0800 Subject: [PATCH] docs: update pluginOptions option, close #446 --- .eslintrc | 2 -- .travis.yml | 1 + docs/guide.md | 24 ++++++++++++++++++++++++ docs/zh/guide.md | 24 ++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index 45c0b91..4e53077 100644 --- a/.eslintrc +++ b/.eslintrc @@ -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, diff --git a/.travis.yml b/.travis.yml index 21b0aca..dd3d511 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: node_js node_js: - lts/* script: + - npm run build - npm run docs:build deploy: provider: pages diff --git a/docs/guide.md b/docs/guide.md index 965f296..be625e5 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -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 diff --git a/docs/zh/guide.md b/docs/zh/guide.md index 1c32535..391ceb6 100644 --- a/docs/zh/guide.md +++ b/docs/zh/guide.md @@ -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