Git Product home page Git Product logo

springboot-dplayer's Introduction

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

springboot-dplayer's People

Contributors

echisan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.