From ce936277e3d309273e4bdfc5dc3a64e34382dab9 Mon Sep 17 00:00:00 2001 From: WooLNinesun Date: Tue, 29 Aug 2017 17:06:59 +0800 Subject: [PATCH] add option.danmaku.margin to prevent block video subtitles --- demo/index.html | 5 ++++- src/html.js | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/demo/index.html b/demo/index.html index 001ff57..d4eb9d6 100644 --- a/demo/index.html +++ b/demo/index.html @@ -23,7 +23,10 @@ }, danmaku: { id: '9E2E3368B56CDBB4', - api: 'https://api.prprpr.me/dplayer/' + api: 'https://api.prprpr.me/dplayer/', + margin: { + bottom:'15%' + } } }); diff --git a/src/html.js b/src/html.js index 8ed39ca..124e559 100644 --- a/src/html.js +++ b/src/html.js @@ -13,7 +13,7 @@ const html = { ${option.logo ? ` ` : ``} -
+
@@ -174,6 +174,16 @@ const html = {
`; }, + danmakumargin: (margin) => { + let result = ''; + if (margin) { + for (const key in margin) { + result += `${key}:${margin[key]};`; + } + } + return result; + }, + contextmenuList: (contextmenu) => { let result = '
'; for (let i = 0; i < contextmenu.length; i++) {