0.2.0 • Published 7 years ago
@bsonntag/react-video v0.2.0
@bsonntag/react-video
A react component that handles video properties and methods by prop.
Installation
Using npm:
$ npm install --save @bsonntag/react-videoUsing yarn:
$ yarn add @bsonntag/react-videoThis module uses react's createRef API,
so make sure you have at least version 16.3.0 installed.
Example usage
import Video from '@bsonntag/react-video';
import React from 'react';
const App = () => (
<Video
play
src={'https://www.sample-videos.com/video/mp4/480/big_buck_bunny_480p_1mb.mp4'}
volume={0.5}
/>
);Props
The Video component supports all
video attributes
plus the following props:
play- A boolean prop that makes the component callvideo.play()when true, orvideo.pause()when false.srcObject- Can be used to pass a MediaStream to thevideo.srcObjectproperty.volume- Sets the value ofvideo.volume. Must be between 0 and 1.
Contributing
Please feel free to submit any issues or pull requests.
License
MIT