0.1.6 • Published 7 years ago

ice-video v0.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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

fieldtypedefaultnote
autoPlaybooleanfalsewhether to automatically play
preloadstring'auto'
posterstring''
loopbooleanfalseloop for video
volumenumber0.8palyer's volume
controlsbooleantruecontrol player
scalestring'16:9'scale of player
durationnumber6000danmuku display duration,unit ms
opacitynumber1the transparency of danmuku

Danmuku

Server danmuku format conventions

fieldtypenote
contentstringthe content of a danmuku
dateDatethe time when send a danmuku
fontColorstringcolor of danmuku
fontSizestringfontSize of danmuku: 'middle' , 'small' , 'large'
modelstringmodel of danmuku: 'roll' , 'top' , 'buttom'
timepointnumbervideo playback position

for example:

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

LICENSE

MIT @ CNO

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago