artplayer-plugin-danmuku
Danmuku plugin for ArtPlayer
Demo
Checkout the demo from Github Pages
Install
Install with npm
$ npm install artplayer-plugin-danmuku
Or install with yarn
$ yarn add artplayer-plugin-danmuku
import artplayerPluginBacklight from 'artplayer-plugin-danmuku';
Or umd builds are also available
<script src="artplayer-plugin-danmuku.js"></script>
Will expose the global variable to window.artplayerPluginDanmuku
.
Usage
var art = new Artplayer({
container: '.artplayer-app',
url: 'path/to/video.mp4',
plugins: [artplayerPluginDanmuku({
danmuku: [
{
text: '666',
time: 5,
color: '#fff',
border: false,
mode: 'scroll',
}
],
speed: 5,
opacity: 1,
color: '#fff',
size: 25,
maxlength: 50,
margin: [10, 20],
synchronousPlayback: false,
})],
});
art.plugins.artplayerPluginDanmuku.emit({
text: '666',
time: 5,
color: '#fff',
size: 25,
border: false,
mode: 'scroll',
});
art.plugins.artplayerPluginDanmuku.hide();
art.plugins.artplayerPluginDanmuku.show();
art.plugins.artplayerPluginDanmuku.config({
});
License
MIT © Harvey Zack