Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

artplayer-plugin-danmuku

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

artplayer-plugin-danmuku

Danmuku plugin for ArtPlayer

  • 3.5.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
797
increased by8.29%
Maintainers
1
Weekly downloads
 
Created
Source

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 artplayerPluginDanmuku 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', // Danmu text
                    time: 5, // Video time
                    color: '#fff', // Danmu color
                    border: false, // Danmu border
                    mode: 0, // Danmu mode: 0-scroll or 1-static
                },
            ], // Can be an array or return the promised function or danmuku xml url
            speed: 5, // Animation time
            opacity: 1, // Opacity
            color: '#fff', // Font color
            size: 25, // Font size
            maxlength: 50, // The maximum number of words in the danmu
            margin: [10, 20], // Margin top and margin bottom
            synchronousPlayback: false, // Synchronous playback speed
        }),
    ],
});

// Send a new danmu
art.plugins.artplayerPluginDanmuku.emit({
    text: '666', // Danmu text
    time: 5, // Video time
    color: '#fff', // Danmu color
    size: 25, // Danmu size
    border: false, // Danmu border
    mode: 0, // Danmu mode: 0-scroll or 1-static
});

// Hide the danmu
art.plugins.artplayerPluginDanmuku.hide();

// Show the danmu
art.plugins.artplayerPluginDanmuku.show();

// Returns whether to hide the danmu
art.plugins.artplayerPluginDanmuku.isHide;

// Config danmu dynamically
art.plugins.artplayerPluginDanmuku.config({
    // option
});

License

MIT © Harvey Zack

Keywords

FAQs

Package last updated on 20 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc