Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to embed YouTube videos without cookies?

In the past we could embed YouTube videos without cookies by simply pointing to a different URL, so for example https://youtube-nocookie.com/embed/sRrqF8eXs38 to get the version without cookies.

This does not work any longer. The URL returns a 404, where the cookie version still exists.

I could not find any reference on how to do it now.

like image 986
mcbetz Avatar asked Mar 02 '17 12:03

mcbetz


People also ask

How do I stop YouTube cookies?

To block cookies from iFrame embedded pages like youtube you need to watch their embed settings. In Youtube there is an option to enable advanced privacy options (see image right). If you enable this you will see, that the embed src changes to “youtube-nocookie.com”.

Are YouTube cookies strictly necessary?

Consent is required because analytics cookies are not strictly necessary to provide the service that the user requests. For example, the user can access your online service whether analytics cookies are enabled or not.

What does YouTube Nocookie do?

YouTube has an alternative domain, youtube-nocookie.com, that can be used to load an embedded video without automatically setting any cookies. However, when the user plays the video, YouTube places cookies, even when the video is loaded with this domain.


1 Answers

Use the www version, that works perfectly fine: https://www.youtube-nocookie.com/embed/sRrqF8eXs38

That is the version their automatic code generator outputs as well, when you chose the extended privacy option.

Looks like they removed the non-www version for some reason. (Although doing that without adding an automatic redirect would be kind of a weird move. Perhaps it is just a temporary problem or error.)

like image 167
CBroe Avatar answered Oct 11 '22 10:10

CBroe