Embed YouTube video via a cookieless domain
Previous article Next articleSince the EU Cookie Law and the new General Data Protection Regulation law the use of (tracking) cookies is controversial. You need a cookie consent feature when embedding YouTube videos at your website to comply with these laws...
I was looking for a way to embed YouTube videos without asking for consent to set cookies. Thought of, and created, very complex cookieless (sub)domains, iframes in pop-ups, etc... But the solution is *very* simple.............. TOO [beeeep] SIMPLE!!!
How to use
The solution is add "-nocookie" to the domain name!! youtube-nocookie.com is a domain that won't set cookies when you watch videos...
The usual method
Cookieless method
Working example
Comment Form
ReviewManager
ReviewManager
3 Comments
Thanks for the addition, Arnoud
Thank you for this blog. Serving video's via the nocookie domain stopped some anoying advertisements seen on a view videos I shared.
I share most of my video's with the hd=1 parameter for non mobile and hd=0 for mobile devices, I use CGExtensions to determine the device type.
$cge = cms_utils::get_module('CGExtensions');
$browser = new Browser();
$ismobile = $browser->isMobile();
According to the player_parameters documentation "showinfo": Note: This parameter is deprecated and will be ignored after September 25, 2018.
https://developers.google.com/youtube/player_parameters
How instagram video or image embed ??? Please your code