react-video-play
React video player for TypeScript and JavaScript like youtube
Demo react-video-play
How to install
npm i react-video-play --save
How to import
For TypeScript usage there is an index.d.ts in node_modules folder
;
or
var ReactVideoPlay = ;var VideoSourceType = VideoSourceType;
How to use
CSS
Use css and images. There is a public folder in node_modules/react-video-play
node_modules/react-video-play/public/css/react-video-play.css
TSX / JSX
ReactVideoPlay sources= poster="http://lorempixel.com/900/450/people/" advComponent= enableSlider= sliderSlides= autoplay= muted= /
Options
sources
(Source[], required) - video source's interfaces for TypeScript implementations
Source example
; // or const VideoSourceType = require('react-video-play').VideoSourceType; ;
enableSlider
(boolean, default: false) - enable preview sliderhideSliderInMobile
(boolean, default: true) - hide slider in mobile devicessliderSlides
(VideoSliderSlide[], required if enableSlider installed true) - slides
sliderSlides example
slides:
enableAdv
(boolean, default: true) - enable ADV, it will be shown whenever player pauseadvComponent
(JSX.Element, required if enableAdv installed true) - React component for ADVposter
(string, default: none) - show preview video imagewidth
(number, default: none) - video container widthheight
(number, default: none) - video container heightcontrols
(boolean, default: true) - controlsautoplay
(boolean, default: false) - autoplay video after startmuted
(boolean, default: false) - muted by defaultshowSourceName
(boolean, default: false) - prefer source name to HQ iconambiLight
(boolean, default: false) - switch on Philips ambilightloaderColor
(string, default: "#fff") - default loader color
For development
just use:
$ yarn or $ npm i
$ npm run dev
open your browser http://localhost:3000
For Build
$ npm run production