/danmu

Collision detection, highly customized danmu screen styles, you deserve it. (碰撞检测,高度自定义的弹幕样式,你值得拥有) 😘

Primary LanguageTypeScriptMIT LicenseMIT

danmu

build status NPM version

English | 简体中文

A highly extensible danmaku library with a robust plugin system, occlusion prevention, and collision detection, implemented based on CSS, DOM, and hooks-plugin.

Usage

import { create } from 'danmu';

const manager = create(
  plugin: {
    $createNode({ node, data }) {
      // Render danmaku content to the DOM
      node.textContent = data;
    },
  },
);

// Initialize
manager.mount(document.getElementById('root'));
manager.startPlaying();

// Send danmuku
manager.push('danmaku content');