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:
Screenshot of the error

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

CommentFileSizeAuthor
Error 153.png62.04 KBprudloff
Command icon 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

prudloff created an issue. See original summary.

prudloff changed the visibility of the branch 3.x to hidden.

prudloff’s picture

Status: Active » Needs review
mably’s picture

Thanks @prudloff for your MR.

Seems reasonable to me to match YouTube default iframe code.

Let's merge this.

  • mably committed d00f2605 on 3.x authored by prudloff
    Issue #3550450 by prudloff, mably: Add referrerpolicy attribute
    
mably’s picture

Status: Needs review » Fixed

Ported to 3.x.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dudeweb’s picture

ok 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...