feat: use nocookie version of youtube & vimeo for help center embeds (#11061)

This pull request includes changes to the `CustomMarkdownRenderer` class
and its corresponding tests to support YouTube's "nocookie"
[[ref](https://support.google.com/youtube/answer/171780?hl=en#zippy=%2Cturn-on-privacy-enhanced-mode)]
URLs and adding the `dnt` param to Vimeo embed
[[ref](https://help.vimeo.com/hc/en-us/articles/12426260232977-About-Player-parameters)].

![CleanShot 2025-03-11 at 19 39
36@2x](https://github.com/user-attachments/assets/e7a3e9b1-35a6-4c8c-bdc2-005f773b3d04)

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
Shivam Mishra
2025-03-12 10:32:25 +05:30
committed by GitHub
parent 86b948ecbd
commit 5c05e45206
2 changed files with 16 additions and 30 deletions

View File

@@ -79,7 +79,7 @@ class CustomMarkdownRenderer < CommonMarker::HtmlRenderer
%(
<div style="position: relative; padding-bottom: 62.5%; height: 0;">
<iframe
src="https://www.youtube.com/embed/#{video_id}"
src="https://www.youtube-nocookie.com/embed/#{video_id}"
frameborder="0"
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
@@ -105,7 +105,7 @@ class CustomMarkdownRenderer < CommonMarker::HtmlRenderer
%(
<div style="position: relative; padding-bottom: 62.5%; height: 0;">
<iframe
src="https://player.vimeo.com/video/#{video_id}"
src="https://player.vimeo.com/video/#{video_id}?dnt=true"
frameborder="0"
allow="autoplay; fullscreen; picture-in-picture"
allowfullscreen