u2sb u2sb
Home
  • 弹幕服务器 (opens new window)
  • MetingJS.Server
  • vuepress-plugin-smplayer
  • vuepress-plugin-vssue-global (opens new window)
  • hexo-tag-mmedia
  • 通用弹幕服务器
  • OBS导播键盘
GitHub (opens new window)
Home
  • 弹幕服务器 (opens new window)
  • MetingJS.Server
  • vuepress-plugin-smplayer
  • vuepress-plugin-vssue-global (opens new window)
  • hexo-tag-mmedia
  • 通用弹幕服务器
  • OBS导播键盘
GitHub (opens new window)
  • Overview

  • MetingJsServer

  • vuepress-plugin-smplayer

  • hexo-tag-mmedia

  • Danmu.Server

    • 安装和基本介绍
    • 在宝塔面板安装
    • 原始弹幕
    • DPlayer 弹幕
      • 介绍
      • API V3
        • DPlayer 弹幕
        • 解析 BiliBili 弹幕
      • 示例
    • ArtPlayer 弹幕
  • OpenSw
  • Danmu.Server
MonologueChi
2022-05-18
目录

DPlayer 弹幕

# 介绍

适合 DPlayer 使用的弹幕

# API V3

# DPlayer 弹幕

# API

  • /api/dplayer/

# 示例

  • https://danmu.u2sb.com/api/dplayer/

# 解析 BiliBili 弹幕

# 解释

  • id aid 或 bvid,例如 av810872 或 BV18b411j72u
  • p 分 P,例如 1 2 ,省略时默认为 1

# API

  • /api/dplayer/v3/bilibili/{id}/{p:int?}
  • /api/dplayer/v3/bilibili/danmu/?bvid={id}&p={p}

# 示例

  • https://danmu.u2sb.com/api/dplayer/v3/bilibili/BV18b411j72u
  • https://danmu.u2sb.com/api/dplayer/v3/bilibili/danmu/?bvid=BV18b411j72u

# 返回

{
  "code": 0,
  "data": [
    [12.544, 0, 16777215, "3600fffd", "来了"],
    [7.739, 0, 16777215, "5689bb4c", "第一,截图见证"],
    [30.225, 0, 16777215, "b21ea9d5", "国风真美!!!"],
    [25.077, 0, 16777215, "260d013c", "好像真的是第一"]
  ]
}
1
2
3
4
5
6
7
8
9

# 示例

点击查看
<div ref="dp"></div>
1
export default {
  mounted() {
    this.$nextTick(() => {
      import("dplayer").then(({ default: DPlayer }) => {
        this.dp = new DPlayer({
          container: this.$refs.dp,
          video: {
            url: "/assets/video/s_720.mp4",
            thumbnails: "/assets/video/thumbnails.jpg",
          },
          danmaku: {
            api: "https://danmu.u2sb.com/api/dplayer/",
            id: "cENuyhsT2rMOCohK",
            addition: ["https://danmu.u2sb.com/api/dplayer/v3/bilibili/BV1zt411t79A"],
          },
        })
      });
    })
  },

  beforeDestroy() {
    this.dp.destroy();
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

提示

一定要把 id 改掉,别 TM 傻逼呵呵的直接用我测试视频的 id 直接就写上去了,自己想办法随便生成一个随机字符串。

#开源项目#Danmu.Server
上次更新: 10/4/2022, 11:21:17 PM
原始弹幕
ArtPlayer 弹幕

← 原始弹幕 ArtPlayer 弹幕→

Theme by Vdoing | Copyright © 2018-2022 MonoLogueChi | CC BY-NC-SA 4.0
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式