npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@wiidede/dan-player

v0.3.0

Published

Dan Player is a bullet screen player component developed based on Vue, supporting MKV format, and supporting ASS, SRT subtitles.Dan Player 是一个基于 Vue 开发的弹幕播放器组件,支持MKV格式,支持ASS、SRT字幕

Readme

npm version npm downloads bundle JSDocs License

Dan Player

Dan Player 是一个基于 Vue 开发的弹幕播放器组件,支持MKV格式,支持ASS、SRT字幕 Dan Player is a bullet screen player component developed based on Vue, supporting MKV format, and supporting ASS, SRT subtitles.

Features

  • 基础功能:播放、控制

  • 弹幕功能(基于Comment Core Library)

  • 键盘快捷键

  • 国际化,支持中文、英文已经自定义

  • 支持 MKV 格式,读取srt、ass字幕 by @wiidede/ebml

  • ass字幕显示 by ASS.js

  • Basic functions: play, control

  • Danmaku feature (based on Comment Core Library)

  • Keyboard shortcuts

  • Internationalization, supports Chinese, English and customization

  • Supports MKV format, reads srt, ass subtitles by @wiidede/ebml

  • ass subtitle display by ASS.js

Demo

Online Demo 在线演示

Quick Start

1. Installation

pnpm add @wiidede/dan-player

2. Usage in Vue

In Single-File Components (SFC)

<script setup lang="ts">
import DanPlayer from '@wiidede/dan-player'
import { ref } from 'vue'
import '@wiidede/dan-player/dist/index.css' // Import the component's stylesheet

const comments = ref([
  // Fill in your actual comment data here, following the format of ICommentCCL type
])
const additionalFunctions = ref(['loop', 'picture-in-picture'])
const locale = ref('en')
</script>

<template>
  <DanPlayer
    :comments="comments"
    autoplay-on-comment-load
    :additional-functions="additionalFunctions"
    :locale="locale"
  />
</template>

Install Globally

import DanPlayer from '@wiidede/dan-player'
// main.ts
import { createApp } from 'vue'
import '@wiidede/dan-player/dist/index.css'

const app = createApp(App)
app.component('DanPlayer', DanPlayer)
app.mount('#app')
declare module 'vue' {
  export interface GlobalComponents {
    DanPlayer: typeof import('dan-player')['default']
  }
}

unplugin-vue-components

import { DanPlayerResolver } from '@wiidede/dan-player/resolver'

// and then add `DanPlayerResolver()` into resolvers

Props

| Name | Type | Description | Default | | --------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ----------- | | comments | ICommentCCL[] | An array containing the comment data to be displayed as CCL. | undefined | | autoplayOnCommentLoad | boolean | A boolean flag indicating whether the video should automatically start playing once the comments are loaded. | false | | additionalFunctions | ('loop' \| 'picture-in-picture')[] | An array specifying additional functions to enable for the player, such as loop playback and Picture-in-Picture mode. | [] | | locale | I18nLocale \| I18nMessages | The language setting for internationalization. It determines which language's text content will be displayed in the component. | 'en' | | src | string \| Blob | The source URL or Blob object of the video to be played. | undefined |

Events

| Name | Description | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | onCommentLoad | This event is emitted when the comment data has been successfully loaded. Parent components can listen to this event to perform additional operations upon comment data availability. |

Exposed Properties and Methods

The component exposes several properties and methods via defineExpose for external components to interact with and control the video player more precisely:

| Name | Type | Description | | --------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------- | | playing | boolean | Indicates whether the video is currently playing or paused. | | currentTime | number | Represents the current playback time of the video in seconds. | | duration | number | Holds the total duration of the video in seconds. | | (other relevant properties) | (types) | (describe the types and purposes of other exposed properties like volume, muted, isPictureInPicture, etc., if applicable) | | togglePlay | Function | A method that can be called to toggle the play/pause state of the video. | | (other relevant methods) | (Function) | (describe the functionality of other exposed methods such as togglePictureInPicture, toggleFullscreen, etc., if there are more) |

Styling Customization

与修改element-plus主题保持一致,不过只能修改颜色

License

MIT License © 2023-PRESENT wiidede