react-videojs-hook
A React hook for video.js
Install using npm
npm install --save react-videojs-hooknpm install --save video.js
Install using yarn
yarn add react-videojs-hookyarn add video.js
Usage
;; ;
Hook Parameters
Param | Description | Required | Default |
---|---|---|---|
src |
The video source URL | true |
|
className |
className to customize video player UI | false |
|
sources |
The sources for a media asset. [{src: 'http://ex.com/video.mp4', type: 'video/mp4'}] |
false |
false |
aspectRatio |
The value to set the Player's aspect ratio to | false |
|
controls |
Set to true or false to display native player controls |
false |
false |
autoplay |
Set the autoplay option, true or false |
false |
false |
textTrackSettings |
Manipulate Text Tracks settings. | false |
|
defaultVolume |
Video player initial volume | false |
false |
responsive |
Set responsive mode to add and remove classes based on its size breakpoints | false |
false |
responsive |
Set responsive mode to add and remove classes based on its size breakpoints | false |
false |
width |
Set player width | false |
auto |
height |
Set player height | false |
auto |
height |
Set player height | false |
auto |
bigPlayButton |
Set initial play button that shows before the video has played | false |
true |
onReady |
Triggered when player is loaded and ready to play | false |
|
onPlay |
Triggered when player's play button is clicked | false |
|
onPause |
Triggered when player's pause button is clicked | false |
|
onTimeUpdate |
Triggered every time play time updates | false |
|
onSeeking |
Triggered on player seeking to a different play time | false |
|
onSeeked |
Triggered on player seeking completion to a different play time | false |
|
onEnd |
Triggered when video finishes playing | false |
How to contribute
To contribute, fork this repo to your private repository and create a pull request based on the feature you want to add.
License
MIT © Hector101