mirror of
https://github.com/DIYgod/DPlayer
synced 2024-11-22 18:56:54 +00:00
add option.danmaku.margin to prevent block video subtitles
This commit is contained in:
parent
8eb07af09a
commit
ce936277e3
@ -23,7 +23,10 @@
|
||||
},
|
||||
danmaku: {
|
||||
id: '9E2E3368B56CDBB4',
|
||||
api: 'https://api.prprpr.me/dplayer/'
|
||||
api: 'https://api.prprpr.me/dplayer/',
|
||||
margin: {
|
||||
bottom:'15%'
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
12
src/html.js
12
src/html.js
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user