Socket
Socket
Sign inDemoInstall

@u-wave/react-youtube

Package Overview
Dependencies
7
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @u-wave/react-youtube

YouTube player component for React.


Version published
Weekly downloads
3.3K
increased by14.1%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

0.6.0 - 2018-06-11

  • Cue instead of load video when autoplay is disabled, see #24.
  • Fix event passthrough, see #26.

Readme

Source

@u-wave/react-youtube

YouTube player component for React.

Install - Usage - Demo - Props

Install

npm install --save @u-wave/react-youtube

Usage

Demo - Demo source code

import YouTube from '@u-wave/react-youtube';

<YouTube
  video="x2to0hs"
  autoplay
/>

Props

NameTypeDefaultDescription
videostringAn 11-character string representing a YouTube video ID..
idstringDOM ID for the player element.
classNamestringCSS className for the player element.
widthunionWidth of the player element.
heightunionHeight of the player element.
pausedboolPause the video.
autoplayboolfalseWhether the video should start playing automatically.
https://developers.google.com/youtube/player_parameters#autoplay
showCaptionsboolfalseWhether to show captions below the video.
https://developers.google.com/youtube/player_parameters#cc_load_policy
controlsbooltrueWhether to show video controls.
https://developers.google.com/youtube/player_parameters#controls
disableKeyboardboolfalseIgnore keyboard controls.
https://developers.google.com/youtube/player_parameters#disablekb
allowFullscreenbooltrueWhether to display the fullscreen button.
https://developers.google.com/youtube/player_parameters#fs
langstringThe player's interface language. The parameter value is an ISO 639-1 two-letter language code or a fully specified locale.
https://developers.google.com/youtube/player_parameters#hl
annotationsbooltrueWhether to show annotations on top of the video.
https://developers.google.com/youtube/player_parameters#iv_load_policy
startSecondsnumberTime in seconds at which to start playing the video.
https://developers.google.com/youtube/player_parameters#start
endSecondsnumberTime in seconds at which to stop playing the video.
https://developers.google.com/youtube/player_parameters#end
modestBrandingboolfalseRemove most YouTube logos from the player.
https://developers.google.com/youtube/player_parameters#modestbranding
playsInlineboolfalseWhether to play the video inline on iOS, instead of fullscreen.
https://developers.google.com/youtube/player_parameters#playsinline
showRelatedVideosbooltrueWhether to show related videos after the video is over.
https://developers.google.com/youtube/player_parameters#rel
showInfobooltrueWhether to show video information (uploader, title, etc) before the video starts.
https://developers.google.com/youtube/player_parameters#showinfo
volumenumberThe playback volume, as a number between 0 and 1.
mutedboolWhether the video's sound should be muted.
suggestedQualitystringThe suggested playback quality.
https://developers.google.com/youtube/iframe_api_reference#Playback_quality
playbackRatenumberPlayback speed.
https://developers.google.com/youtube/iframe_api_reference#setPlaybackRate
onReadyfunctionSent when the YouTube player API has loaded.
onErrorfunctionSent when the player triggers an error.
onCuedfunction() => {}Sent when the video is cued and ready to play.
onBufferingfunction() => {}Sent when the video is buffering.
onPlayingfunction() => {}Sent when playback has been started or resumed.
onPausefunction() => {}Sent when playback has been paused.
onEndfunction() => {}Sent when playback has stopped.
onStateChangefunction
onPlaybackRateChangefunction
onPlaybackQualityChangefunction

License

MIT

Keywords

FAQs

Last updated on 11 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc