0.1.2 • Published 3 years ago

youtube-privacy-embed v0.1.2

Weekly downloads
1
License
GPL-3.0
Repository
-
Last release
3 years ago

Basilicom's Youtube Privacy Embed

Latest Version on NPM Software License

This package allows you to include Videos from YouTube in a privacy enforced way. After opening the page, the user also has to check a checkbox and with this accept the privacy terms. Only then the connection to YouTube is established and the regular YouTube embed iframe is included.

Install

You can install the package via yarn or npm:

$ yarn add youtube-privacy-embed
$ npm install youtube-privacy-embed --save

Usage

Setup

JavaScript:

import * as youtubePrivacyEmbed from 'youtube-privacy-embed';

youtubePrivacyEmbed.initialize('js-privacy-embed');

If wanted, you can also include a basic css file:

@import "node_modules/youtube-privacy-embed/dist/style.css";

Usage

Include the following HTML snippet where you want to show the YouTube video:

<div class="js-privacy-embed"
    data-ype-video-id="ZT4WRRhacWk">
    
</div>

Configuration

You can find the default configuration and all possible options in the config.json file.

You can overwrite them with own parameters on the initialization, like this:

youtubePrivacyEmbed.initialize('js-privacy-embed', {
    useNoCookie: false,
    videoAutoplay: true
});

You can also overwrite the defaults (and your settings from the configuration) via data-attributes in the html part, where you at least should include the video id. Please note the changed property names: You must prepend it with data-ype-, and convert uppercase letters to - plus their lowercase equivalent. Eg. the property videoAllowFullscreen in the JS settings become data-ype-video-allow-fullscreen when you set it via the data attributes.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please contact basilicom instead of using the issue tracker.

License

The GPL License (GPL v3.0). Please see License File for more information.

Credits

About Basilicom

We design and program applications that are far beyond out-of-the-box-solutions. Online, mobile, social. Official Pimcore partner.

0.1.2

3 years ago

0.1.1

4 years ago

0.1.0

4 years ago