add option.danmaku.margin to prevent block video subtitles

This commit is contained in:
WooLNinesun 2017-08-29 17:06:59 +08:00
parent 8eb07af09a
commit ce936277e3
2 changed files with 15 additions and 2 deletions

View File

@ -23,7 +23,10 @@
},
danmaku: {
id: '9E2E3368B56CDBB4',
api: 'https://api.prprpr.me/dplayer/'
api: 'https://api.prprpr.me/dplayer/',
margin: {
bottom:'15%'
}
}
});
</script>

View File

@ -13,7 +13,7 @@ const html = {
${option.logo ? `
<div class="dplayer-logo"><img src="${option.logo}"></div>
` : ``}
<div class="dplayer-danmaku">
<div class="dplayer-danmaku" style="${option.danmaku ? html.danmakumargin(option.danmaku.margin) : ``}">
<div class="dplayer-danmaku-item dplayer-danmaku-item--demo"></div>
</div>
<div class="dplayer-bezel">
@ -174,6 +174,16 @@ const html = {
<div class="dplayer-notice"></div>`;
},
danmakumargin: (margin) => {
let result = '';
if (margin) {
for (const key in margin) {
result += `${key}:${margin[key]};`;
}
}
return result;
},
contextmenuList: (contextmenu) => {
let result = '<div class="dplayer-menu">';
for (let i = 0; i < contextmenu.length; i++) {