Skip to content

Investigate if generic Embeds with Vimeo videos size correctly #16191

Description

@arelra

When @guardian/commercial-dev implemented hosted content pages they had to implement handling for generic embeds.

This led to the discovery that when Vimeo embeds are included on a page the iframe does not have the correct width and height set.

This is because the existing enhance-embeds.ts module strips any surrounding HTML which may contain styling that comes from Composer / Frontend

const iframe = dom.querySelector('iframe');
if (iframe && element.alt) {
iframe.setAttribute('title', element.alt);
return {
...element,
...{
html: iframe.outerHTML,

See the Vimeo embed present on the Frontend rendered page:

https://www.theguardian.com/advertiser-content/visa-2020/why-digital-equity-is-fundamental-to-pandemic-recovery?dcr=false

This does not currently render on the DCR hosted content pages:

https://www.theguardian.com/advertiser-content/visa-2020/why-digital-equity-is-fundamental-to-pandemic-recovery?dcr=true

Rendering on DCR was implemented on the following branch:

https://github.com/guardian/dotcom-rendering/tree/rd/embed-iframe-testing-hosted-content

An additional chat thread:

https://chat.google.com/room/AAAAWaoV0IE/F5GMTZmGGas/s4qf-IYyBqQ?cls=10

We should find an article with a generic embed containing a Vimeo video and confirm if they are sized correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions