Skip to content

Commit

Permalink
更新插件依赖的dplayer版本,支持bilibili弹幕池,修改介绍
Browse files Browse the repository at this point in the history
  • Loading branch information
Myer921 authored and Myer921 committed Oct 12, 2016
1 parent 1b0ddf3 commit 14e2f8a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ If any issue occurs, tell me via issue, use a hexo raw tag like below to use dpl
api: 'https://dplayer.daoapp.io/', // Required, danmaku api
token: 'tokendemo', // Optional, danmaku token for api
maximum: 1000 // Optional, maximum quantity of danmaku
addition: ['https://dplayer.daoapp.io/bilibili?aid=4157142'] // Optional, additional danmaku, see: `Bilibili 弹幕支持`
}
}
var dp = new DPlayer(option);
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ hexo.extend.filter.register('after_post_render', function(data) {

// {% dplayer key=value ... %}
hexo.extend.tag.register('dplayer', function(args) {
let url, api, loop, autoplay, theme, pic, did, token, screenshot, lang, maximum, hotkey, preload, width, height;
let url, api, loop, autoplay, theme, pic, did, token, screenshot, lang, maximum, hotkey, preload, width, height, addition;
var id = 'dplayer' + (counter++);
for (var i = 0; i < args.length; ++i) {
var arg=args[i];
Expand Down Expand Up @@ -119,6 +119,9 @@ hexo.extend.tag.register('dplayer', function(args) {
case 'height':
height = arg.slice(arg.indexOf("=")+1);
break;
case 'addition':
addition = arg.slice(arg.indexOf("=")+1);
break;
}
}
var raw = '<div id="'+ id + '" class="dplayer" style="margin-bottom: 20px;'+(height?" width:"+width+";":"")+(height?" height:"+height+";":"")+'"></div>';
Expand All @@ -138,6 +141,7 @@ hexo.extend.tag.register('dplayer', function(args) {
pic: pic
},
danmaku: (api == undefined ? undefined :{
addition: [addition],
api: api,
id: did,
token: token,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-tag-dplayer",
"version": "0.1.4",
"version": "0.1.5",
"description": "Embed dplayer in Hexo posts/pages",
"main": "index.js",
"scripts": {
Expand All @@ -25,7 +25,7 @@
},
"homepage": "https://github.com/NextMoe/hexo-tag-dplayer#readme",
"dependencies": {
"dplayer": "^1.0.10",
"dplayer": "^1.1.1",
"hexo-fs": "^0.1.3",
"hexo-util": "^0.1.7"
}
Expand Down

0 comments on commit 14e2f8a

Please sign in to comment.