1.0.1 • Published 6 years ago

react-lazy-youtube v1.0.1

Weekly downloads
85
License
MIT
Repository
-
Last release
6 years ago

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:

NameTypeDefaultDescription
idStringRequired
imageSizeenumdefaultSize of the thumbnail we get from youtube (default, hqdefault, mqdefault, sddefault, maxresdefault )
noCookiesboolfalseif set to true will change the host to "https://www.youtube-nocookie.com"
onEndfuncnoopFunctinn that runs on the end of the video
onErrorfuncnoopFunction that runs when the video encounters an error
onPausefuncnoopFunction that runs when the video is paused
onPlayfuncnoopfunction to run when the video starts Playing
onPlaybackQualityChangefuncnoopFunction that runs when the video changes quality
onPlaybackRateChangefuncnoopFunction that runs when the video encounters changes playback rate
onStateChangefuncnoopFunction that runs when the video changes state like from playing to paused
playerVarsobject{}https://developers.google.com/youtube/player_parameters
stylesobject{}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.