Video player configuration error 153 on iOS for @angular/youtube-player #32325
Replies: 20 comments
-
|
We need to mention |
Beta Was this translation helpful? Give feedback.
-
|
Yes I am aware of that and I did try to add using : and also in player config But nothing worked. |
Beta Was this translation helpful? Give feedback.
-
|
You're on the right track. Adding the attribute in this way does not reload the iframe, so you need to unset the src field and reinitialize it. Something like: +const ngZone = inject(NgZone);
if (iframe) {
+ ngZone.runOutsideAngular(() => {
iframe.setAttribute(
'referrerpolicy',
'strict-origin-when-cross-origin'
);
+ const src = iframe.src;
+ iframe.src = undefined;
+ setTimeout(() => { iframe.src = src; }, 0);
+ });
}You may not need the From what I saw briefly, the player config doesn't support arbitrary new attributes, and referrer policy isn't yet supported. I think the "proper" fix will require a complete refactor to use the iframe tag directly rather than creating it programmatically. Of course, if Google/YouTube reverts the need for this attribute, then no fixes will be required. Someone from the core team will need to make the decision. cc/ @crisbeto @devversion |
Beta Was this translation helpful? Give feedback.
-
|
@ajitzero Thanks! I get your point I will look into it tonight and hopefully get it working. But definitely need fix for this within the library itself. |
Beta Was this translation helpful? Give feedback.
-
|
It doesn't seems to be working I tried your suggestion something like this : |
Beta Was this translation helpful? Give feedback.
-
|
@sidsaxena0 Joining in. Alot of people are having the same issue since end of August. Thats when Youtube updated their minimum requirements. https://developers.google.com/youtube/terms/required-minimum-functionality There are alot of bandage solutions out there but most are hit or miss. Some of our apps are affected with this as well so was hoping there were open/close issues for this. But surprisingly, this ticket is the only one. :( |
Beta Was this translation helpful? Give feedback.
-
|
Any solution for this? We are also facing the same issue |
Beta Was this translation helpful? Give feedback.
-
|
I'm really not sure that the referer policy will be enough. In a hosted web page, with a correct domain, OK, that will do. But for app bundled and served locally, such as with capacitor, electron or other similar context, the origin of the page is either not sent as |
Beta Was this translation helpful? Give feedback.
-
|
I'm also having the same problem, it's only happening on iOS = ( |
Beta Was this translation helpful? Give feedback.
-
|
We're using Angular for our mobiles apps. On Android the embedded youtube iframe videos work but on iOS, the player displays that 153 error. Its a iOS issue mostly. Its been more than a month since this cropper up but so far no solution has been introduced other than hit and miss ways. |
Beta Was this translation helpful? Give feedback.
-
|
I'm facing the same fucking error, developing for iOS, wrapping my app using Capacitor (not Angular). None of the "solutions" I've tried is solving the 153 error. Thanks YouTube… 🤬 |
Beta Was this translation helpful? Give feedback.
-
|
I also have this problem. Only iOS. Works great on Android and Web. I always get a 153 error page from YouTube embedded videos. I tried:
This is a really bad issue and I can't figure out anything that could fix this. Does anybody know if there is a way to escalate this further somehow? |
Beta Was this translation helpful? Give feedback.
-
|
@laki889 Unfortunately no solution at the moment bud. :( |
Beta Was this translation helpful? Give feedback.
-
|
I'm facing the same problem. I'll follow this discussion in the hope of a solution. |
Beta Was this translation helpful? Give feedback.
-
|
@laki889 This is the Google Issue Tracker with an issue related to this problem: https://issuetracker.google.com/issues/457483150 But trying to understand the problem I'm starting to consider that maybe the root cause of the problem would be on the WebKit implementation on iOS (because it works fine on Safari for macOS). |
Beta Was this translation helpful? Give feedback.
-
|
@josepcrespo @novaylt123 I was able to resolve the issue by adapting the solution explained in this Medium article: Long story short - you need to use a YT proxy in order to provide all request parameters that YT expects now. |
Beta Was this translation helpful? Give feedback.
-
@laki889 In those apps, the proxy route would require a heavy refactor for these apps to control the proxy via post messaging. Plus, post messaging just adds another layer of latency and vulnerability if misused. I think, like most devs, we are waiting for a hoisted solution until committing hours to a proxy/postMessage solution. I suspect this relates to the custom schema not being https in capacitator/cordova/etc apps, which unfortunately, can't be set for iOS and hence why it is working in Android. |
Beta Was this translation helpful? Give feedback.
-
@BrainstemStudio That's exactly the issue. This also happens if your app is served with |
Beta Was this translation helpful? Give feedback.
-
The YouTube error 153 occurs on iOS because the WebView blocks YouTube iframes due to cookie restrictions and origin (CORS) policies. To work around this, I created an intermediate HTML page (“relay”) inside the app, which securely loads the video using the youtube-nocookie.com domain. This page receives the video ID via parameter (?v=VIDEO_ID) and manually builds the iframe with the correct permissions, without third-party cookies, and with a valid origin (origin: capacitor://localhost). With this setup, the video now plays normally on iOS without triggering error 153. This is my temporary solution — if anyone has a better approach, please share it. If I find a more robust alternative, I’ll update it here as well. |
Beta Was this translation helpful? Give feedback.
-
|
Converting to discussion with https://b.corp.google.com/issues/457483150?pli=1 tracking YouTube issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Description
When using the
@angular/youtube-playercomponent to embed YouTube videos in an Angular application, iOS devices display a “Video player configuration error 153” and the video fails to play. Desktop and Android devices do not experience this issue. Similar symptoms have been reported by other projects ([github.com](toeverything/AFFiNE#13848)).Steps to reproduce
@angular/youtube-player.<youtube-player [videoId]="'VIDEO_ID'"></youtube-player>to a component template.Expected behavior
The YouTube video should load and play correctly on iOS, just as it does on desktop and Android platforms.
Actual behavior
On iOS devices, the video area displays “Video player configuration error 153” and does not play the video.
Environment
Additional context
The issue persists even when using the
youtube-nocookie.comdomain for the embed. Reproduced across multiple iOS devices and networks.Reproduction
N/A – this bug occurs only in a Capacitor mobile app on iOS and cannot be reproduced via an online StackBlitz because it depends on the native iOS player. To reproduce, follow these steps in a Capacitor project:
@angular/youtube-player.ionic buildandnpx cap add ios).<youtube-player [videoId]="'VIDEO_ID'"></youtube-player>with a valid video ID.ionic capacitor run ios.Expected Behavior
The embedded YouTube player should load and play the specified video normally on iOS just like it does on desktop and Android. Users should not see a “Video player configuration error 153”.
Actual Behavior
On iOS devices using an Ionic/Capacitor mobile application, the embedded YouTube video fails to play and instead shows an error message: "Video player configuration error 153". The issue does not occur on desktop or Android devices.
Environment
Beta Was this translation helpful? Give feedback.
All reactions