mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
28 lines
817 B
JavaScript
28 lines
817 B
JavaScript
var art = new Artplayer(
|
|
{
|
|
container: '.artplayer-app',
|
|
url: '/assets/sample/video.mp4',
|
|
autoSize: true,
|
|
fullscreen: true,
|
|
fullscreenWeb: true,
|
|
plugins: [
|
|
artplayerPluginDanmuku({
|
|
danmuku: '/assets/sample/danmuku-v2.xml',
|
|
speed: 5,
|
|
opacity: 1,
|
|
fontSize: 20,
|
|
maxlength: 100,
|
|
margin: ['10%', 60],
|
|
antiOverlap: true,
|
|
useWorker: true,
|
|
synchronousPlayback: false,
|
|
filter: (danmu) => danmu.text.length < 50,
|
|
}),
|
|
],
|
|
},
|
|
function () {
|
|
const danmuku = document.querySelector('.artplayer-danmuku');
|
|
art.plugins.artplayerPluginDanmuku.mount(danmuku);
|
|
},
|
|
);
|