Video atom as main media in articles - poster image fix#14300
Video atom as main media in articles - poster image fix#14300KaliedaRik merged 6 commits intomainfrom
Conversation
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
jonathonherbert
left a comment
There was a problem hiding this comment.
Tested locally w/ video articles, this LGTM! Would we also want the same thing for main media in other article-like layouts, e.g. LiveLayout?
Stumbled across some interesting context in a comment on frontend on the rationale for using overrideImage in the first place:
Since moving to Atoms, the multimedia team have commented that they're reluctant to use videos
in main media as it makes the content look stale. This is because an Atom only has 1 image. Before Atoms, it was
possible to set a different image for a video on each use. This change is bringing that functionality back.
source: guardian/frontend#20637
|
After discussion, we've decided not to add any specific fix for Liveblogs that use video for their main media - mainly because of the difficulty of testing at a time when no liveblogs are using video for their main media. Will be happy to open a new issue/PR when the requirement is raised again. |
|
Seen on PROD (merged by @KaliedaRik 9 minutes and 2 seconds ago) Please check your changes! |
What does this change?
This fix forces articles that use video atoms generated in Media Atom Maker as their main media to use the 16:9 aspect ratio placeholder image over the video (before user interaction to play the video).
Why?
By default the importable YoutubeBlockComponent will use the article's trail image, if it is available, for its poster image. Since the redesign these trail images, which are also used for Fronts, are often created with a 5:4 aspect ratio. However MAM videos are still created in 16:9 aspect ratio; this means that when the override image is used for the video poster the top and bottom edges of the image will be auto-cropped (via CSS
object-fit: cover) to display over the video before play commences.To test
In CODE, test the example links.
Perform some additional smoke checking to make sure the fix only impacts MAM-generated Video Article pages. Normal (Composer-generated) articles that use video for their main media should not be impacted, nor should this change have any impact on looping video in the Fronts
Run the Chromatic tests