react-light-video

react-light-video is a web video player using React library.

Usage no npm install needed!

<script type="module">
  import reactLightVideo from 'https://cdn.skypack.dev/react-light-video';
</script>

README

react-light-video

react-light-video is a web video player using React library.

Installation

npm install --save react-light-video

import react-light-video in your project:

import Player from 'react-light-video';

export default props => {
  const props = {
    source: 'your video href here',
    controls: true,
    loop: true
  };
  return <Player {...props} />;
};

Options

  • source : Video Link
  • fluid (default: true) : if video player 100% width of its father container
  • aspectRatio (default: '16:9'): videoWidth : videoHeight
  • width(number): ignore when fluid is true
  • height(number): ignore when fluid is true
  • loop (default: false)
  • controls (default: true)
  • autoPlay (default: false)
  • playsInline (default: false)

Events

  • onPlay
  • onPlaying
  • onEnded
  • onPause
  • onTimeUpdate
  • onAbort
  • onRef
  • onLoadStart
  • onWaiting
  • onCanPlay
  • onCanPlayThrough
  • onSeeking
  • onSeeked
  • onProgress
  • onDurationChange
  • onError
  • onSuspend
  • onEmptied
  • onStalled
  • onLoadedMetadata
  • onLoadedData
  • onRateChange
  • onVolumeChange
  • onAutoPlay