@neverfinal/youtube-privacy

1.2.1 • Public • Published

YouTube Privacy Element

An extremely lightweight soluting to replace an existing youtube embed with a gdpr-conform 2-click solution using the WebComponents standard.

Installation

Using npm

npm install --save @neverfinal/youtube-privacy.

Then include the dist/youtube-privacy.js script in your bundle or add it to your website.

Using unpkg

Include the following script tag in the footer of your website:

    <script src="https://unpkg.com/@neverfinal/youtube-privacy"></script>

Usage

  1. Copy the embed code from any YouTube video
    <iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/xxxxxx"
            title="YouTube video player"
            frameborder="0"
            allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
    </iframe>
  1. Replace the iframe tag with youtube-privacy
    <youtube-privacy width="560" height="315" src="https://www.youtube-nocookie.com/embed/xxxxxx"
            title="YouTube video player"
            frameborder="0"
            allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
    </youtube-privacy>

Package Sidebar

Install

npm i @neverfinal/youtube-privacy

Weekly Downloads

1

Version

1.2.1

License

ISC

Unpacked Size

16.8 kB

Total Files

10

Last publish

Collaborators

  • lukas-schardt