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.
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.tsmodule strips any surrounding HTML which may contain styling that comes from Composer / Frontenddotcom-rendering/dotcom-rendering/src/model/enhance-embeds.ts
Lines 12 to 18 in fcc3df3
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.