udpate danmuku example

This commit is contained in:
Harvey Zack committed 2022-04-29 20:42:55 +08:00
1 parent ef66416389
commit 5667235d8d
2 files changed
+10 -9

No files matched your search

+8 -7
View File
@@ -8,30 +8,31 @@ var art = new Artplayer({
artplayerPluginDanmuku({
danmuku: '/assets/sample/danmuku.xml',
speed: 5,
maxlength: 50,
margin: [10, 100],
opacity: 1,
fontSize: 25,
fontSize: 20,
maxlength: 100,
margin: ['10%', 60],
synchronousPlayback: false,
filter: (danmu) => danmu.text.length < 50,
}),
],
controls: [
{
position: 'right',
html: '隐藏弹幕',
html: '隐藏',
click: function (_, event) {
if (art.plugins.artplayerPluginDanmuku.isHide) {
art.plugins.artplayerPluginDanmuku.show();
event.target.innerText = '隐藏弹幕';
event.target.innerText = '隐藏';
} else {
art.plugins.artplayerPluginDanmuku.hide();
event.target.innerText = '显示弹幕';
event.target.innerText = '显示';
}
},
},
{
position: 'right',
html: '发送弹幕',
html: '发送',
click: function () {
var text = prompt('请输入弹幕文本', '弹幕测试文本');
if (!text || !text.trim()) return;
+2 -2
View File
@@ -121,10 +121,10 @@
artplayerPluginDanmuku({
danmuku: '/assets/sample/danmuku.xml',
speed: 5,
opacity: 1,
fontSize: 20,
maxlength: 50,
margin: ['10%', 60],
opacity: 1,
fontSize: 14,
synchronousPlayback: false,
filter: (danmu) => danmu.text.length < 20,
}),