Don't use cookies when embedding youtube videos

When embedding a video in our site YouTube stores cookies in the user's
computer that aren't necessary to watch the video, so we'd have to make
people accept those cookies before letting them watch the video.

Using a URL that doesn't use cookies, like mentioned in YouTube Help
[1], is easier, though, and respects people's privacy without affecting
the user experience.

That I've found some references saying that youtube does store cookies
once you hit the "play" button even when using the nocookie server [2].
Not sure whether that's an old behavior or I'm doing something wrong,
but I don't see this is the case; even after playing the video, cookies
aren't stored on my browser.

[1] https://support.google.com/youtube/answer/171780#zippy=%2Cturn-on-privacy-enhanced-mode
[2] https://www.cnet.com/news/privacy/youtubes-new-nocookie-feature-continues-to-serve-cookies/
This commit is contained in:
Javi Martín
2024-05-19 23:36:57 +02:00
parent 738314e685
commit 442156b1cc
3 changed files with 3 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ describe Shared::EmbeddedVideoComponent do
it "embeds a youtube video for youtube URLs" do
allow(record).to receive(:video_url).and_return "http://www.youtube.com/watch?v=a7UFm6ErMPU"
embed_url = "https://www.youtube.com/embed/a7UFm6ErMPU"
embed_url = "https://www.youtube-nocookie.com/embed/a7UFm6ErMPU"
render_inline component