Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

echisan/springboot-dplayer

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

springboot-dplayer

使用java实现的dplayer弹幕接口后端

找个机会重构一下

环境依赖

  • jdk 1.8
  • mongodb
  • redis
  • maven

演示地址:https://darker.me/

安装

打包使用maven,所以需要先安装好maven

在根目录下,即有pom.xml文件的目录下执行

mvn package -Dmaven.test.skip=true

默认打包成jar,想打包成war的可自行搜索

运行

java -jar springboot-player.jar

使用

不支持获取b站弹幕,其他用法一致

const dp = new DPlayer({
            container:document.getElementById('dplayer'),
            video:{
                url:'http://danmaku.echisan.cn/static/video/the-day.mp4'
            },
            danmaku:{
		id:'thedaydanmaku',
                api:'http://api.echisan.cn/dplayer/',
		user:'echisan'
            }
        });

update log

  • 新增了基于jwt的token验证,需要把token放到请求头上,请求头key为Authorization,值为Bearer {token}

token

# header
{
  "typ": "JWT",
  "alg": "HS512"
}
# payload
{
  "loc": 0,
  "sub": "gaygui2",
  "ema": 0,
  "iss": "DMCollection",
  "exp": 1527415398,
  "iat": 1526983398,
  "rol": "ROLE_USER"
}
  • 修复了发弹幕时可能会出现的413的问题
  • 完善了token验证的功能,支持在发送弹幕的参数中加入token,使用时需要把代码中的注释先取消掉,在弹幕请求参数中加入token

About

使用java实现的dplayer弹幕接口后端

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.