Giter Club home page Giter Club logo

ice-video's Introduction

ice-video

The web danmuku video player built from the ground up for an HTML5 world using React library.

npm build MIT License

website

ScreenShot

ScreenShot

Installation

Install ice-video via NPM

npm install --save ice-video react react-dom isomorphic-fetch

import stylesheet

import "http://ice-video.coolecho.net/static/video.min.css";

or import scss

import "node_modules/ice-video/src/assets/sass/video.scss"

Import the components where you need, example:

import React from 'react';
import ReactDOM from 'react-dom';
import IceVideo from 'ice-video';

const Player = () => {
  const settings = {
    loop: true,
    autoPlay: false,
    preload: 'auto',
    poster: '',
    volume: 0.5,
    getDanmukuUrl: 'http://127.0.0.1:3001/danmuku',
    sendDanmukuUrl: 'http://127.0.0.1:3001/senddanmu',
    controls: true,
    scale: '16:9',
    src: './video.mp4',
  };
  return (
    <IceVideo {...settings} />
  );
}

export default Player;

Config

Options

field type default note
autoPlay boolean false whether to automatically play
preload string 'auto'
poster string ''
loop boolean false loop for video
volume number 0.8 palyer's volume
controls boolean true control player
scale string '16:9' scale of player
duration number 6000 danmuku display duration,unit ms
opacity number 1 the transparency of danmuku

Danmuku

Server danmuku format conventions

field type note
content string the content of a danmuku
date Date the time when send a danmuku
fontColor string color of danmuku
fontSize string fontSize of danmuku: 'middle' , 'small' , 'large'
model string model of danmuku: 'roll' , 'top' , 'buttom'
timepoint number video playback position

for example:

{
  content: "233",
  date: "2017-06-03T05:40:26.616Z",
  fontColor: "white",
  fontSize: "middle",
  model: "roll",
  timePoint: 3.014076
}

LICENSE

MIT @ Alchemy

ice-video's People

Contributors

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