1.2.1 • Published 3 years ago
@neverfinal/youtube-privacy v1.2.1
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
- 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>
- Replace the
iframe
tag withyoutube-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>