Problem/Motivation
Some users are complaining about some "Error 153" displayed by the player.
We compared the embed generated by the YouTube share feature with the iframe generated by video_embed_field and it seems to come down to this attribute that is present on the version generated by YouTube but not in video_embed_field : referrerpolicy="strict-origin-when-cross-origin"
Steps to reproduce
Unfortunately, we haven't been able to reproduce the issue consistently, it only happens to some users.
It might depend on how the browser is configured and seems to be linked to a strict referrer policy on the website (for example our site uses <meta name="referrer" content="same-origin" />).
I guess YouTube loves tracking users so much that it triggers an error when the request does not have a referrer header.
Here is a screenshot of the error provided by users:

Proposed resolution
We could add the attribute in YouTube::renderEmbedCode().
strict-origin-when-cross-origin means YouTube will only get the root URL of the website, not the exact URL of the page.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| Error 153.png | 62.04 KB | prudloff |
Issue fork video_embed_field-3550450
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
prudloff commentedComment #5
mably commentedThanks @prudloff for your MR.
Seems reasonable to me to match YouTube default iframe code.
Let's merge this.
Comment #8
mably commentedPorted to 3.x.
Comment #11
dudeweb commentedok my bad!!
this is how I call the link in my twig file. this was missing: referrerpolicy="strict-origin-when-cross-origin" So it's solved but I leave it here if somebody did the same...