Giter Site home page Giter Site logo

lcsouzamenezes / zaojiu-player Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hi-noikiy/zaojiu-player

0.0 0.0 0.0 2.31 MB

A live stream video player, compatible with mobile.

Home Page: https://duxiaofeng-github.github.io/zaojiu-player/

JavaScript 33.08% HTML 11.72% TypeScript 20.75% CSS 2.28% ActionScript 29.63% SCSS 2.53%

zaojiu-player's Introduction

Zaojiu player

A live stream video player, compatible with mobile.

Feature

  • Responsive
  • Quality control by settings
  • Rtmp support by its flash video plugin

Install

yarn add zaojiu-player

or

npm i zaojiu-player

Usage

<div id="player" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0;"></div>
import { ZaojiuPlayer } from "zaojiu-player";
import { FlashVideo } from "zaojiu-player/dist/zaojiu-player-flash.plugin";

// if you don't want to play rtmp live stream, you can the remove following line
ZaojiuPlayer.use(FlashVideo);

const srcRtmp = {
  src: "rtmp://ali-live.zaojiu.com/zaojiu/59313bd2647259000183041d_sd?auth_key=1512472740-0-0-845571a71200e6c83807d4e399f3ad00",
  quality: "Live",
  mimetype: "rtmp/mp4",
};

const srcMD = {
  src: "http://7qnbk6.com1.z0.glb.clouddn.com/The-Battle-of-Evony-MD.mp4",
  quality: "高清",
  mimetype: "video/mp4",
};

const srcSD = {
  src: "http://7qnbk6.com1.z0.glb.clouddn.com/The-Battle-of-Evony-SD.mp4",
  quality: "标清",
  mimetype: "video/mp4",
};

const srcHD = {
  src: "http://7qnbk6.com1.z0.glb.clouddn.com/The-Battle-of-Evony-HD.mp4",
  quality: "超清",
  mimetype: "video/mp4",
};

const player = new ZaojiuPlayer({
  element: "player", // html element id
  playList: [srcSD, srcMD, srcHD],
  autoplay: true,
  swf: "static/video-js.swf",
});

// you can control video player by using its instance
setTimeout(() => {
  player.video.el.pause();
}, 3000);

more detial, see example

API

You can get its api definitions from here

zaojiu-player's People

Contributors

dev-johnny-gh avatar dependabot[bot] 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.