ice-video

阅读时长 5 分钟读完

React component, a danmuku video player package.

ice-video

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

website

ScreenShot

Installation

Install ice-video via NPM

import stylesheet

or import scss

Import the components where you need, example:

-- -------------------- ---- -------
------ ----- ---- --------
------ -------- ---- ------------
------ -------- ---- ------------

----- ------ - -- -- -
  ----- -------- - -
    ----- -----
    --------- ------
    -------- -------
    ------- ---
    ------- ----
    -------------- --------------------------------
    --------------- ----------------------------------
    --------- -----
    ------ -------
    ---- --------------
  --
  ------ -
    --------- ------------- --
  --
-

------ ------- -------

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:

LICENSE

MIT @ CNO

HomePage

https://github.com/IceEnd/ice-video#readme

Repository

git+https://github.com/IceEnd/ice-video.git

来源:JavaScript中文网 ,转载请注明来源 https://www.javascriptcn.com/post/6005606a81e8991b448de8dd

纠错
反馈