react-lazy-youtube

1.0.1 • Public • Published

react-lazy-youtube

React Component to lazy load t+youtube videos by showing only the thumbnail of the video untill the person clicks on it as seen on https://awesometalks.party

Demo: https://react-lazy-youtube.now.sh/

Props:

Name Type Default Description
id String Required
imageSize enum default Size of the thumbnail we get from youtube (default, hqdefault, mqdefault, sddefault, maxresdefault )
noCookies bool false if set to true will change the host to "https://www.youtube-nocookie.com"
onEnd func noop Functinn that runs on the end of the video
onError func noop Function that runs when the video encounters an error
onPause func noop Function that runs when the video is paused
onPlay func noop function to run when the video starts Playing
onPlaybackQualityChange func noop Function that runs when the video changes quality
onPlaybackRateChange func noop Function that runs when the video encounters changes playback rate
onStateChange func noop Function that runs when the video changes state like from playing to paused
playerVars object {} https://developers.google.com/youtube/player_parameters
styles object {} Styles to apply over the wrapper

Contributing

Everyone is welcome to contribute.

Authors and license

Sara Vieira and contributors.

MIT License, see the included License.md file.

Dependencies (5)

Dev Dependencies (12)

Package Sidebar

Install

npm i react-lazy-youtube

Weekly Downloads

59

Version

1.0.1

License

MIT

Unpacked Size

58.3 kB

Total Files

5

Last publish

Collaborators

  • saravieira