Giter Club home page Giter Club logo

douyuhtml5player's Introduction

斗鱼HTML5播放器

基于 flv.js 的斗鱼HTML5播放器.

使用了 flv.js 内核提供的直播流播放, 用 JavaScript 实现了斗鱼的弹幕协议, 并支持发送弹幕和送礼物.

screenshot

使用

不要使用 Chrome 直接加载本文件夹, 本扩展程序需要构建后才能使用.

Chrome 应用商店

Greasy Fork (Firefox)

要求 Chrome 版本大于等于 49 (仅在54+版本测试过)

打开斗鱼的直播间, 如果没有错误, 播放器就已经被自动替换.

注: 如开启了 chrome://flags/#extension-active-script-permission, 请注意允许扩展程序在所有网址上运行, 否则会没有权限运行.

原理

视频播放基于 flv.js, 弹幕发射使用 CSS3, 弹幕协议通过自制一个很小的 Flash 与 JavaScript 通信, 在 JavaScript 中实现斗鱼的弹幕协议.

由于斗鱼使用了 HTTPS, 受到 Mixed Content 限制, 只能在 Background 页面 fetch 视频内容再传到 Content Script 给 flv.js 进行播放.

具体原理请见我的 blog

构建

  1. npm install

  2. npm run build

  3. npm run pack 在 versions 文件夹查看 zip 文件

douyuhtml5player's People

Contributors

spacemeowx2 avatar

Watchers

 avatar  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.