react-trailer
v1.2.2
Published
Video Player for React
Downloads
14
Readme
NPM
npm i react-trailer --save
Import the components needed to build your video player:
import {
VideoPlayer,
Viewer,
Controls,
PlayButton,
FullscreenButton,
ProgressControl,
DurationControl,
} from 'react-trailer';
<VideoPlayer>
<Viewer>
<Viewer.Source src="http://dl5.webmfiles.org/big-buck-bunny_trailer.webm" type="video/webm" />
</Viewer>
<Controls>
<ProgressControl />
<PlayButton>
{({ isPlaying }) => (isPlaying ? 'Pause' : 'Play')}
</PlayButton>
<FullscreenButton>
{({ isFullscreen }) => (isFullscreen ? 'Close' : 'Fullscreen')}
</FullscreenButton>
<DurationControl />
</Controls>
</VideoPlayer>
Install dependencies, build the source files and preview
git clone https://github.com/Naimikan/react-trailer.git
npm install
npm run build && npm start