Gathering detailed insights and metrics for react-youtube
Gathering detailed insights and metrics for react-youtube
Gathering detailed insights and metrics for react-youtube
Gathering detailed insights and metrics for react-youtube
react-player
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion
react-native-youtube-iframe
A simple wrapper around the youtube iframe js API for react native
react-lite-youtube-embed
A private by default, faster and cleaner YouTube embed component for React applications
@plasmicpkgs/react-youtube
Plasmic registration call for react-youtube
npm install react-youtube
Typescript
Module System
Min. Node Version
Node Version
NPM Version
90.3
Supply Chain
100
Quality
75.7
Maintenance
100
Vulnerability
100
License
TypeScript (95.68%)
JavaScript (2.52%)
HTML (0.72%)
CSS (0.66%)
Shell (0.41%)
Total Downloads
59,502,457
Last Day
21,930
Last Week
253,583
Last Month
1,557,260
Last Year
16,704,002
1,864 Stars
413 Commits
222 Forks
20 Watching
7 Branches
45 Contributors
Minified
Minified + Gzipped
Latest Version
10.1.0
Package Id
react-youtube@10.1.0
Unpacked Size
72.48 kB
Size
10.63 kB
File Count
7
NPM Version
8.19.1
Node Version
16.14.2
Cumulative downloads
Total Downloads
Last day
-71.2%
21,930
Compared to previous day
Last week
-33.7%
253,583
Compared to previous week
Last month
-1%
1,557,260
Compared to previous month
Last year
13.9%
16,704,002
Compared to previous year
Simple React component acting as a thin layer over the YouTube IFrame Player API
1npm install react-youtube
1yarn add react-youtube
1pnpm add react-youtube
1<YouTube 2 videoId={string} // defaults -> '' 3 id={string} // defaults -> '' 4 className={string} // defaults -> '' 5 iframeClassName={string} // defaults -> '' 6 style={object} // defaults -> {} 7 title={string} // defaults -> '' 8 loading={string} // defaults -> undefined 9 opts={obj} // defaults -> {} 10 onReady={func} // defaults -> noop 11 onPlay={func} // defaults -> noop 12 onPause={func} // defaults -> noop 13 onEnd={func} // defaults -> noop 14 onError={func} // defaults -> noop 15 onStateChange={func} // defaults -> noop 16 onPlaybackRateChange={func} // defaults -> noop 17 onPlaybackQualityChange={func} // defaults -> noop 18/>
For convenience it is also possible to access the PlayerState constants through react-youtube:
YouTube.PlayerState
contains the values that are used by the YouTube IFrame Player API.
1// js 2import React from 'react'; 3import YouTube from 'react-youtube'; 4 5class Example extends React.Component { 6 render() { 7 const opts = { 8 height: '390', 9 width: '640', 10 playerVars: { 11 // https://developers.google.com/youtube/player_parameters 12 autoplay: 1, 13 }, 14 }; 15 16 return <YouTube videoId="2g811Eo7K8U" opts={opts} onReady={this._onReady} />; 17 } 18 19 _onReady(event) { 20 // access to player in all event handlers via event.target 21 event.target.pauseVideo(); 22 } 23}
1// ts 2import React from 'react'; 3import YouTube, { YouTubeProps } from 'react-youtube'; 4 5function Example() { 6 const onPlayerReady: YouTubeProps['onReady'] = (event) => { 7 // access to player in all event handlers via event.target 8 event.target.pauseVideo(); 9 } 10 11 const opts: YouTubeProps['opts'] = { 12 height: '390', 13 width: '640', 14 playerVars: { 15 // https://developers.google.com/youtube/player_parameters 16 autoplay: 1, 17 }, 18 }; 19 20 return <YouTube videoId="2g811Eo7K8U" opts={opts} onReady={onPlayerReady} />; 21}
You can access & control the player in a way similar to the official api:
The
APIcomponent will pass an event object as the sole argument to each ofthose functionsthe event handler props. The event object has the following properties:
- The event's
target
identifies the video player that corresponds to the event.- The event's
data
specifies a value relevant to the event. Note that theonReady
event does not specify adata
property.
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 13/14 approved changesets -- score normalized to 9
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More