fix: resolve YouTube Error 153 by adding origin param and removing no-referrer

YouTube's embed API requires knowing the embedding origin to authorize
playback. The referrerPolicy="no-referrer" was stripping the Referer
header, and the missing origin param meant youtube-nocookie.com couldn't
verify the embed source, causing Error 153 (video player configuration
error). Fix: pass origin param explicitly and let the browser send the
default referrer.
This commit is contained in:
Jannis Braun
2026-03-21 00:26:32 +01:00
parent c0133397e3
commit a3db74c7f7
@@ -34,11 +34,10 @@ export function VideoEmbed({ embed }: VideoEmbedProps) {
{isPlaying && embed.embedUrl ? ( {isPlaying && embed.embedUrl ? (
<iframe <iframe
className="absolute inset-0 w-full h-full" className="absolute inset-0 w-full h-full"
src={`${embed.embedUrl}?autoplay=1`} src={`${embed.embedUrl}?autoplay=1&origin=${encodeURIComponent(window.location.origin)}`}
title={embed.title ?? 'Video'} title={embed.title ?? 'Video'}
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowFullScreen allowFullScreen
referrerPolicy="no-referrer"
/> />
) : ( ) : (
<button <button