YouTube Embed Error 153 Resolution Points to Stricter Referrer-Policy Enforcement

Image for YouTube Embed Error 153 Resolution Points to Stricter Referrer-Policy Enforcement

Website developers encountering "Error 153: Video player configuration error" on embedded YouTube videos are finding a solution in adjusting their Referrer-Policy HTTP header. The issue, which has caused widespread disruption for sites and applications utilizing YouTube embeds, appears to stem from YouTube's recent tightening of security requirements for referrer information.

Software engineer Simon Willison recently highlighted a fix for this problem on social media, stating, "if you get 'Error 153: Video player configuration error' on YouTube videos embedded on your site a likely culprit is sending the 'Referrer-Policy: same-origin' HTTP header." He further explained, "Switching to 'strict-origin-when-cross-origin' fixed it for me."

The core of the problem lies with YouTube's expectation of a valid referrer. When an embedded YouTube video loads on a page with a restrictive referrer policy, such as same-origin or no-referrer, the necessary identification information is withheld, triggering Error 153. This indicates that YouTube cannot properly verify the request due to missing or incorrect referrer policy settings.

The Referrer-Policy header dictates how much referrer information is sent with requests. While same-origin restricts referrer data to requests within the same origin, strict-origin-when-cross-origin sends the full URL for same-origin requests and only the origin for cross-origin requests, which satisfies YouTube's requirement without exposing sensitive path information. This change is often necessary for websites, webviews, and applications like Obsidian and Feedly, which have also reported similar issues.

Developers can implement the fix either by configuring their web server to send the Referrer-Policy: strict-origin-when-cross-origin HTTP header or by directly adding referrerpolicy="strict-origin-when-cross-origin" to their YouTube iframe embed code. This adjustment ensures that YouTube receives the required referrer data, allowing embedded videos to play correctly and restoring functionality across various platforms.