项目作者: MoePlayer

项目描述 :
DPlayer Danmaku
高级语言: PHP
项目地址: git://github.com/MoePlayer/laravel-danmaku.git
创建时间: 2018-01-25T16:43:54Z
项目社区:https://github.com/MoePlayer/laravel-danmaku

开源协议:MIT License

下载


Laravel Danmaku

GitHub license

Installation

You can install the package via composer:

  1. composer require moeplayer/laravel-danmaku

Copy the package migration to your local migration with the publish command:

  1. php artisan vendor:publish --tag danmaku
  2. php artisan migrate

Add danmakuv2 to the csrf whitelist

  1. // app\Http\Middleware\VerifyCsrfToken.php
  2. protected $except = [
  3. 'danmakuv2'
  4. ];

Usage

  1. const dp = new DPlayer({
  2. container: document.getElementById('dplayer'),
  3. screenshot: true,
  4. video: {
  5. url: 'demo.mp4',
  6. pic: 'demo.jpg',
  7. thumbnails: 'thumbnails.jpg'
  8. },
  9. danmaku: {
  10. id: 'demo',
  11. api: 'http://domain/danmakuv2',
  12. user: 'dog'
  13. }
  14. });