2.7.1 • Published 2 years ago
@wbe/react-video-player v2.7.1
@wbe/react-video-player
React video player is a wrapper component for native, vimeo and youtube video.
Installation
$ npm install -s @wbe/react-video-player
How to use
Import VideoPlayer:
import { VideoPlayer, EVideoType } from "@wbe/react-video-player";
// ...
const App = () => {
return (
<VideoPlayer
type={EVideoType.NATIVE}
className={`native`}
url={"https://video-url"}
play={true}
style={{ display: "block" }}
controls={false}
muted={true}
autoPlay={true}
onPause={e => console.log("pause callback", e)}
onPlay={e => console.log("play callback", e)}
onEnded={e => console.log("ended callback", e)}
onReady={e => console.log("ready callback", e)}
/>
);
};
Or import an available sub video component to access extra available props:
import { YoutubeVideo } from "@wbe/react-video-player";
// ...
const App = () => {
return (
<YoutubeVideo
id={"youtube-id"}
play={true}
// specific props available only for youtube video
fs={false}
/>
);
};
You can easily create your own VideoPlayer component and import sub video component as needed.
Parameters / Props
props (* non optional) | type | description | default value | @type |
---|---|---|---|---|
type* | EVideoType | Type of video | / | / |
id | string | Video ID (ID will overwrite URL) | / | VIMEO & YOUTUBE |
url | string | Video URL | / | all |
play | boolean | Play, pause, resume video | / | all |
style | CSSProperties | Add root component style | / | all |
autoPlay | boolean | Autoplay video on init | false | all |
controls | boolean | Show controls on video | true | all |
loop | boolean | Loop video | false | all |
playsInline | boolean | Plays inline video on mobile | true | all |
muted | boolean | Mute video | false | all |
onReady | (event:any) => void | Execute function when video is ready | / | all |
onPlay | (event:any) => void | Execute callback function on play state | / | all |
onPause | (event:any) => void | Execute callback function on pause state | / | all |
onEnded | (event:any) => void | Execute callback function on ended state | / | all |
className | string | class list | / | all |
2.7.1
2 years ago
2.7.0
2 years ago
2.5.0
2 years ago
2.6.0-beta.1
2 years ago
2.5.0-alpha.0
2 years ago
2.4.3-alpha.0
2 years ago
2.4.0
3 years ago
2.3.0
3 years ago
2.2.0-alpha.0
3 years ago
2.1.0
3 years ago
2.0.0
3 years ago
2.0.0-alpha.14
3 years ago
2.0.0-alpha.11
3 years ago
2.0.0-alpha.10
3 years ago
2.0.0-alpha.7
3 years ago
2.0.0-alpha.6
3 years ago
2.0.0-alpha.3
3 years ago
2.0.0-alpha.0
3 years ago
2.0.0-alpha.1
3 years ago
2.0.0-alpha.2
3 years ago
1.6.0
3 years ago
1.5.2
3 years ago
1.5.0
3 years ago
1.4.2
4 years ago
1.4.2-alpha.0
4 years ago
1.4.1
4 years ago
1.4.0-alpha.0
4 years ago
1.4.0-alpha.1
4 years ago
1.4.0
4 years ago
1.3.1-alpha.1
4 years ago
1.3.1-alpha.0
4 years ago
1.3.0
4 years ago