Skip to content

Commit 927ba81

Browse files
authored
Merge pull request #192 from sandiegopython/davidfischer/fix-yt-iframe-sandboxing
Fix an issue with YouTube embed sandboxing
2 parents 5d3ebb6 + 8b1c970 commit 927ba81

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pythonsd/templates/pythonsd/fragments/recent-videos.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@
1010
See:
1111
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox
1212
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#allow
13+
* https://developers.google.com/youtube/iframe_api_reference
1314
{% endcomment %}
14-
<iframe class="w-full aspect-video" src="https://www.youtube-nocookie.com/embed/{{ most_recent_video.id }}?html5=1" title="YouTube video player" frameborder="0" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation" allow="autoplay; encrypted-media; picture-in-picture; web-share" allowfullscreen></iframe>
15+
<iframe
16+
class="aspect-video w-full rounded-lg"
17+
src="https://www.youtube-nocookie.com/embed/{{ most_recent_video.id }}?html5=1"
18+
title="YouTube video player"
19+
frameborder="0"
20+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
21+
referrerpolicy="strict-origin-when-cross-origin"
22+
sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation"
23+
allowfullscreen
24+
></iframe>
1525

1626
{% endwith %}
1727
{% else %}

0 commit comments

Comments
 (0)