Skip to content

Video atom as main media in articles - poster image fix#14300

Merged
KaliedaRik merged 6 commits intomainfrom
rjr-fix-video-main-media-poster-images
Aug 13, 2025
Merged

Video atom as main media in articles - poster image fix#14300
KaliedaRik merged 6 commits intomainfrom
rjr-fix-video-main-media-poster-images

Conversation

@KaliedaRik
Copy link
Contributor

@KaliedaRik KaliedaRik commented Jul 29, 2025

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

  1. When running DCAR locally, we can test the following articles in the local test harness:
  1. In CODE, test the example links.

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

  3. Run the Chromatic tests

@KaliedaRik KaliedaRik marked this pull request as draft July 29, 2025 13:28
@github-actions
Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@github-actions
Copy link

github-actions bot commented Jul 29, 2025

@github-actions
Copy link

github-actions bot commented Jul 29, 2025

@KaliedaRik KaliedaRik marked this pull request as ready for review July 30, 2025 15:23
@KaliedaRik KaliedaRik added the run_chromatic Runs chromatic when label is applied label Jul 30, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jul 30, 2025
Copy link
Contributor

@jonathonherbert jonathonherbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@KaliedaRik
Copy link
Contributor Author

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.

@KaliedaRik KaliedaRik added the run_chromatic Runs chromatic when label is applied label Aug 13, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Aug 13, 2025
@KaliedaRik KaliedaRik merged commit e6783cf into main Aug 13, 2025
31 checks passed
@KaliedaRik KaliedaRik deleted the rjr-fix-video-main-media-poster-images branch August 13, 2025 12:40
@prout-bot
Copy link

Seen on PROD (merged by @KaliedaRik 9 minutes and 2 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants