From 429330a7e29a172a85a1fbc227df6f40c85e0243 Mon Sep 17 00:00:00 2001 From: zhw2590582 Date: Sat, 27 Apr 2019 20:13:00 +0800 Subject: [PATCH] build all packages --- dist/artplayer-plugin-danmu.css | 1 + docs/assets/example/github.js | 60 + docs/index.html | 1 + docs/uncompiled/artplayer-tool-github.js | 3032 ++++++++++++++++++ docs/uncompiled/artplayer-tool-github.js.map | 1 + packages/artplayer-tool-github/.npmignore | 9 + packages/artplayer-tool-github/.npmrc | 1 + packages/artplayer-tool-github/README.md | 80 + packages/artplayer-tool-github/package.json | 26 + packages/artplayer-tool-github/src/index.js | 4 + 10 files changed, 3215 insertions(+) create mode 100644 dist/artplayer-plugin-danmu.css create mode 100644 docs/assets/example/github.js create mode 100644 docs/uncompiled/artplayer-tool-github.js create mode 100644 docs/uncompiled/artplayer-tool-github.js.map create mode 100644 packages/artplayer-tool-github/.npmignore create mode 100644 packages/artplayer-tool-github/.npmrc create mode 100644 packages/artplayer-tool-github/README.md create mode 100644 packages/artplayer-tool-github/package.json create mode 100644 packages/artplayer-tool-github/src/index.js diff --git a/dist/artplayer-plugin-danmu.css b/dist/artplayer-plugin-danmu.css new file mode 100644 index 000000000..d3bbf749c --- /dev/null +++ b/dist/artplayer-plugin-danmu.css @@ -0,0 +1 @@ +.artplayerPluginDanmu{display:-webkit-box;display:-ms-flexbox;display:flex} \ No newline at end of file diff --git a/docs/assets/example/github.js b/docs/assets/example/github.js new file mode 100644 index 000000000..2929d0a6d --- /dev/null +++ b/docs/assets/example/github.js @@ -0,0 +1,60 @@ +// 接口每小时限制 5000 次请求,勿滥用 +var github = new ArtplayerToolGithub({ + api: 'zhw2590582/github-issues-api-as-danmuku/issues/1', + clientID: '749a95aad589f8849abe', + clientSecret: '7bb6fa67ef6e525e5bd5fda46cd3925ecc4a3760', +}); + +var url = 'https://zhw2590582.github.io/assets-cdn'; +var art = new Artplayer({ + container: '.artplayer-app', + url: url + '/video/you-name.mp4', + autoSize: true, + controls: [ + { + name: 'danmuku', + position: 'right', + html: '发送弹幕', + click: () => { + if (!github.isLogin) { + github.login(); + } else { + var text = prompt('请输入:', '弹幕内容'); + if (!text || !text.trim()) return; + if (github.remaining <= 10) { + art.notice.show('接口请求到达上限,请稍后再试!!!'); + return; + } + art.notice.show('弹幕发送中...'); + github + .send({ + text: text, + time: art.player.currentTime, + color: '#' + Math.floor(Math.random() * 0xffffff).toString(16), + }) + .then(data => { + art.notice.show(`发送弹幕成功: ${github.remaining} / ${github.limit}`); + art.plugins.artplayerPluginDanmu.emit({ + ...data, + time: art.player.currentTime, + border: data.color, + }); + }).catch(() => { + art.notice.show(`发送弹幕失败: ${github.remaining} / ${github.limit}`); + }); + } + }, + }, + ], + plugins: [ + artplayerPluginDanmu({ + danmus: () => github.cache(), + speed: 5, + opacity: 1, + color: '#fff', + size: 25, + maxlength: 50, + margin: [10, 100], + }), + ], +}); diff --git a/docs/index.html b/docs/index.html index 476c345eb..6dc01ce70 100644 --- a/docs/index.html +++ b/docs/index.html @@ -34,6 +34,7 @@