YouTube error 153 (Video player configuration error): how to fix it
Error 153 appears in an embedded YouTube player when the page or app hosting it doesn't tell YouTube where the request comes from (the HTTP Referer is missing). Site owners usually fix it by changing the Referrer-Policy to `strict-origin-when-cross-origin`. If you only watch videos, you can wait for the site owner to fix it.
On this page
What it means
Error 153 shows up as "Error 153: Video player configuration error" inside a YouTube video that is embedded on another website or in an app. It is not an error on youtube.com itself, and the same video usually plays normally there.
YouTube's IFrame Player API describes code 153 as a request that has no HTTP Referer header or equivalent API client identification. In plain terms, the embedded player wants to know which site or app is asking for it, and the page didn't say. YouTube's policy for embedded players requires that identification and warns that clients which don't provide it may get reduced functionality.
For other playback problems, see YouTube "Something went wrong" and other playback errors.
Symptoms and causes
You are likely dealing with this problem if:
- A black or grey box in place of the video with the text "Error 153 / Video player configuration error".
- The same video plays fine when opened directly on youtube.com.
- It is more often reported on sites with strict security headers, in app WebViews, and in local HTML files.
The usual causes, most common first:
- The page sends a restrictive Referrer-Policy
- A header or meta tag such as
no-referrerorsame-originstops the browser sending the Referer to YouTube. It can come from the framework (Django's SecurityMiddleware defaults tosame-origin), the web server,.htaccess, a CDN, or the host. - App WebView or local HTML with no identity
- A WebView or a
file://or bundled HTML page has no Referer by default, so the app supplies nothing that identifies it to YouTube. - Opening the player with noreferrer
- YouTube's policy says embedded-player clients must not use
noreferrer, for example viawindow.open.
How to fix it
Work through these in order. They start with the quickest, safest checks and move to deeper repairs; stop as soon as the problem is gone.
1.Site owner: stop suppressing the Referer
This is the most common cause and the fix documented in a public write-up of the error. The embed needs the browser to send at least the site's origin.
Before you start: A looser Referrer-Policy sends more information to other sites you link to. Note the old value so you can revert, and check whether other parts of the site depend on it.
- Find where the
Referrer-Policyheader or the referrer meta tag is set: your framework, nginx or Apache config,.htaccess, CDN rules, or hosting panel. - Change it to
strict-origin-when-cross-origin, or remove the header.Referrer-Policy: strict-origin-when-cross-origin - In Django, set this in settings.
SECURE_REFERRER_POLICY = "strict-origin-when-cross-origin" - Clear any CDN or page cache, then reload the page with the embed.
2.Set the referrer policy on the YouTube iframe only
If you can't change the site-wide header, a per-element attribute limits the change to the video. This is general HTML guidance, not something the YouTube documentation describes for error 153.
- Add the
referrerpolicyattribute to the YouTube iframe element, as in the example below.<iframe src="https://www.youtube.com/embed/VIDEO_ID" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> - Save and reload the page.
3.Add origin to the embed URL or try the privacy-enhanced domain
The IFrame API recommends origin for security, but it isn't documented as a cure for 153. The youtube-nocookie.com domain only partly helped in one report, so use these alongside the header fix, not instead of it.
- Add your site's address as the
originparameter.https://www.youtube.com/embed/VIDEO_ID?origin=https://yourdomain.com - Optionally switch the embed to the privacy-enhanced domain.
https://www.youtube-nocookie.com/embed/VIDEO_ID
4.App developers: give a WebView or local page an identity
YouTube's Required Minimum Functionality policy says clients without a default Referer must identify themselves another way.
- When loading local or bundled HTML into a WebView, set
baseUrl, which sets the Referer. - On Android Custom Tabs, set
Intent.EXTRA_REFERRER, and use theandroid-app://scheme for its value. - Don't open the player with
noreferrer.
5.Viewer: test the video
If you don't run the website, this is all you can try.
- Open the video on youtube.com to confirm it is public and embeddable. Private or non-embeddable videos give different codes (100, 101, 150), not 153.
- If it still fails, tell the site owner the exact text of the error. The fix is on their side.
Check that it worked
- Reload the page with a hard refresh (CtrlF5) and the video loads instead of the Error 153 box.
- Open your browser's developer tools, Network tab, and check that the request to youtube.com/embed carries a
Refererheader.
If it still fails
- Check every layer that can add headers (app, web server, CDN, host) and compare the response headers the browser actually receives.
- Test the embed on a plain HTML page on your domain to isolate the cause.
- There is no official YouTube Help article for 153, so if everything above is correct, consult the YouTube API Services documentation or support.
Questions
Is the video itself broken or removed?
Usually not. Removed, private or non-embeddable videos produce other codes. A video that plays on youtube.com but fails only in an embed points to the Referer issue.
Will adding origin to the URL fix it?
Not on its own. It's recommended by the API docs for security, but the documented cause of 153 is the missing Referer or client identification.
Sources
- YouTube IFrame Player API ReferenceOfficial · Google for Developers
- Required Minimum FunctionalityOfficial · Google for Developers (YouTube API Services)
- Error 153 Video player configuration error on YouTube embeds · Simon Willison TIL