npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rn-yt-player

v1.0.4

Published

A package for React Native to embed YouTube video in React Native app without pain. It customizable, so that you can embed secure videos with it.

Downloads

18

Readme

React Native YouTube Video Player 🔥

This is a plugin for React Native making playing YouTube video in React Native without pain.

It includes almost everything a developer needs to do with a YouTube video in his/her app.

Developers can easily modify the player according to their app (till an extent), and choose options they want to show in YouTube player.

Installation

npm install rn-yt-player react-native-webview

Under the hood this package works with react-native-webview, ie make sure that it is also installed.

Usage

Import the package like below

import YouTubePlayer from 'rn-yt-player';

then simply use the package like below

<YouTubePlayer
    videoSource={VIDEO_SOURCE}
/>

Props

| S.N. | Prop Name | Accepted Data Type | Accepted Values | Default | Description | |:----------|:-------------|:------|:---|:---|:---| |1|videoSource|string|Any Youtube Video URL, it can be directly from Browser or sharable link or URL for embeding video provided by YouTube in embed code or it can also be directly Video ID| A Video on Youtube | Provide package the video | |2|startVideoFrom|number \| string| Time in seconds | 0 | Used to set initial point of video, ie video will start from this point to timeframe| |3|width|number \| string|Width for Video Player|"100%"| Sets width to Video Player, also accepts string so that you can use percentage relative to parent| |4|height|number|Height for Video Player|200|Sets height of Video Player. It don't accept string, if you provide it with a string value JavaScript will do something weird.| |5|accentColor|string |color| Differs| Sets colour to seek bar, priotied color to these if these are unset: Initial Play Button| |6|innerPlayButtonColor|string|color|#FFFFFF|Sets colour to interior portion (triangle) in Play Button| |7|playButtonColor|string|color| If both innerPlayButtonColor and accentColor are unset then #000000 else if playButtonColor is unset then accentColor, if playButtonColor is set then it is only priortied.|Sets colour to Play Button (Outer Circle)| |8|hideYTLogo|boolean|true \| false| false|Hides YouTube Logo below seek bar| |9|hideTopBar|boolean|true \| false|false|Hides top bar in YT Video player, ie it hides Channel Profile Picture, Video Title, copy link button, share video button and 3-dots (more) button| |10|hideSettingButton|boolean|true \| false| false | Hides setting button below seek bar| |11|hideCaptionButton|boolean|true \| false|false| Hides caption button below seek bar| |12|hideControls|boolean|true \| false|false|Hides all controls of Video (Seek Bar, Caption Button, Setting Button, Full Screen Button, Volume Button, Play/Pause button below seek bar)| |13|children|React.Component|React.Component|A default loader|Replaces default loader with your Component until the Video is loaded in Player| |14|loaderContainerStyle|object|style|undefined|It is applied only if you are using custom loader by providing one into children prop. It provides access to styling parent component of loader box which covers Video Player until video is loaded. Hence it can be used to tweak background colour for loader|

Example

  • Code
<YouTubePlayer
        videoSource="VIDEO SOURCE"
        innerPlayButtonColor="white"
        hideTopBar={true}
        hideCaptionButton={true}
        hideYTLogo={true}
        accentColor={'green'}
        width="80%"
        height={250}
/>
  • Output
  • Output

Author