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

video-privacy

v1.1.0

Published

This is a simple React component that allows to wrap iframes in to a privacy layer that has to be acknowledged before loading external data. It was originally intended for use in [Docusaurus](https://www.docusaurus.io) but should work in any React context

Downloads

52

Readme

Video Privacy

This is a simple React component that allows to wrap iframes in to a privacy layer that has to be acknowledged before loading external data. It was originally intended for use in Docusaurus but should work in any React context.

Installation

In your project, execute

npm install --save video-privacy

Then, import the component where you wish to use it:

import VideoPrivacy from "video-privacy"

Usage

Simply wrap the embed code in the component, like in this example:

<VideoPrivacy>
    <iframe
        width="800"
        height="450"
        src="https://www.youtube.com/embed/b5c2oawLPU8"
        title="Ontologien - was ist das eigentlich?"
        frameborder="0"
        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
        referrerpolicy="strict-origin-when-cross-origin"
        allowfullscreen
    ></iframe>
</VideoPrivacy>

The component can be customized with props, for example:

<VideoPrivacy
    cookie
    width={1024}
    info="Your text goes here"
    imageUrl="https://your_backdrop.jpg"
>

Allowed Props

  • width
    Description: The width of the privacy container. Should be the same as the width of the iframe to prevent awkward results.
    Type: Number
    Default value: 800

  • info
    Description: The info text to be displayed
    Type: String
    Default value: "Please indicate that you understand that this video is loaded from an external source."

  • buttonText
    Description: The text on the acknowledge button
    Type: String
    Default value: "I understand"

  • cookie
    Description: Save user acknowledgement to a session cookie to suppress further privacy notices
    Type: Boolean
    Default value: false

  • cookieName
    Description: Set a custom name for acknowledgement cookie (useful for differently scoped consent rules across your website)
    Type: String
    Default value: "video-privacy-acknowledged"

  • cookieExpires
    Description: Set a custom expiration period in days for the cookie
    Type: Number
    Default value: empty (i. e., cookie expires after session)

  • imageUrl
    Description: The URL of a preview image to be shown as backrop in the container
    Type: String
    Default value: empty

  • customInfoClass
    Description: A CSS class definition for styling the info text
    Type: String
    Default value: empty

  • customButtonClass
    Description: A CSS class definition for styling the acknowledge button
    Type: String
    Default value: empty