Update danmuku.js

This commit is contained in:
Harvey committed 2020-04-26 08:59:30 +08:00
1 parent b5d5487dcf
commit 7f3b116851
1 file changed
+42 -9
+42 -9
View File
@@ -6,13 +6,46 @@ var art = new Artplayer({
setting: true, setting: true,
playbackRate: true, playbackRate: true,
fullscreenWeb: true, fullscreenWeb: true,
plugins: [artplayerPluginDanmuku({ plugins: [
danmuku: url + '/danmuku/your-name.xml', artplayerPluginDanmuku({
speed: 5, danmuku: url + '/danmuku/your-name.xml',
maxlength: 50, speed: 5,
margin: [10, 100], maxlength: 50,
opacity: 1, margin: [10, 100],
fontSize: 25, opacity: 1,
synchronousPlayback: false, fontSize: 25,
})], synchronousPlayback: false,
}),
],
controls: [
{
position: 'right',
html: 'Hide',
click: function () {
art.plugins.artplayerPluginDanmuku.hide();
},
},
{
position: 'right',
html: 'Show',
click: function () {
art.plugins.artplayerPluginDanmuku.show();
},
},
{
position: 'right',
html: 'Send',
click: function () {
var text = prompt('Please enter', 'Danmu text');
if (!text || !text.trim()) return;
var color = '#' + Math.floor(Math.random() * 0xffffff).toString(16);
art.plugins.artplayerPluginDanmuku.emit({
text: text,
color: color,
border: color,
time: art.player.currentTime + 0.2,
});
},
},
],
}); });