2.7.1 • Published 2 years ago

@wbe/react-video-player v2.7.1

Weekly downloads
269
License
MIT
Repository
github
Last release
2 years ago

@wbe/react-video-player

React video player is a wrapper component for native, vimeo and youtube video.

npm.io npm.io npm.io npm.io npm.io

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)typedescriptiondefault value@type
type*EVideoTypeType of video//
idstringVideo ID (ID will overwrite URL)/VIMEO & YOUTUBE
urlstringVideo URL/all
playbooleanPlay, pause, resume video/all
styleCSSPropertiesAdd root component style/all
autoPlaybooleanAutoplay video on initfalseall
controlsbooleanShow controls on videotrueall
loopbooleanLoop videofalseall
playsInlinebooleanPlays inline video on mobiletrueall
mutedbooleanMute videofalseall
onReady(event:any) => voidExecute function when video is ready/all
onPlay(event:any) => voidExecute callback function on play state/all
onPause(event:any) => voidExecute callback function on pause state/all
onEnded(event:any) => voidExecute callback function on ended state/all
classNamestringclass 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