Skip to content

Conversation

@domlander
Copy link
Contributor

@domlander domlander commented Jan 13, 2026

What does this change?

Limit the aspect ratio a Front Card self-hosted video can be. If a video is "taller" than 5:4, crop the top and bottom to only render the middle part of the video.

On Fronts cards on desktop, use grey bars at the top/bottom of the video container if the video is "wider" than 5:4. On mobile, the container should hug the video and no grey bars will be seen.

There was code within the SelfHostedVideo island that was specific to the fronts card or the feature card that had to be worked around by the other, or other calling components. To remedy this, and to make the island easier to use for calling components, the following changes to props have been made:

  • containerAspectRatioDesktop and containerAspectRatioMobile replaces containerAspectRatio. This change allows a container to be set on mobile and is more explicit to the caller with regard to breakpoints when the video container will be locked to a specific aspect ratio.
  • letterboxed is replaced by minAspectRatio and maxAspectRatio. Letterboxed infers that the video will have grey bars to its side, but this is not always true. It depends on the aspect ratio of the video and the aspect ratio of the container. Creating these two props allows the calling component to specify its configuration and remove Fronts Card specific config from the island.
  • isFeatureCard is removed. A component should not know as little as possible about its caller. Feature Card specific properties can now be determined through the new set of props alone.

Why?

Vertical videos do not look good when allowed to render in 9:16 on Front cards. The videos are designed to look good when they are cropped to 5:4.

Maximum height limits are unnecessary now that the tallest video aspect ratio we support on front cards is 5:4. These height limits were not applicable for Feature Cards or videos in Articles. It is unlikely that there are many instances where a video will render full-width on a square-ish viewport: on tablets the videos won't render full-width; on mobiles the viewport is unlikely to be less "tall" than 5:4.

5:3 videos were breaking out of the viewport. We now support these wide aspect ratios.

Screenshots

  • Wide video desktop: For fronts cards videos wider than the container, we still want to show the whole video without cropping. Instead, show grey bars above and below.
  • Tall video desktop/mobile: On fronts cards, the tallest a video can be is 4:5. Videos taller than this should be cropped equally at the top and bottom.
  • Feature card wide. Always fill the entirety of the feature card. We don't want grey bars here. Crop the video so that it fits a 4:5 container.
Before After
Wide video desktop mobile-before mobile-after
Tall video desktop tablet-before tablet-after
Tall video mobile desktop-before desktop-after
Feature card wide feature-wide-before feature-wide-after

@domlander domlander self-assigned this Jan 13, 2026
@domlander domlander added run_chromatic Runs chromatic when label is applied fronts + curation maintenance Departmental tracking: maintenance work, not a fix or a feature labels Jan 13, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jan 13, 2026
@domlander domlander force-pushed the doml/crop-tall-video branch from af0f861 to 0e435f3 Compare January 20, 2026 09:12
@github-actions
Copy link

github-actions bot commented Jan 20, 2026

@github-actions
Copy link

github-actions bot commented Jan 20, 2026

@domlander domlander force-pushed the doml/crop-tall-video branch from 0e435f3 to 2ab92b7 Compare January 20, 2026 09:19
@domlander domlander added the run_chromatic Runs chromatic when label is applied label Jan 20, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jan 20, 2026
@domlander domlander force-pushed the doml/crop-tall-video branch from bb1033b to af7f749 Compare January 20, 2026 21:52
@domlander domlander added the run_chromatic Runs chromatic when label is applied label Jan 21, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jan 21, 2026
@domlander domlander added the run_chromatic Runs chromatic when label is applied label Jan 21, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jan 21, 2026
@domlander domlander force-pushed the doml/crop-tall-video branch from aff35cc to 2f603c3 Compare January 21, 2026 09:11
@domlander domlander marked this pull request as ready for review January 21, 2026 09:11
@domlander domlander added the run_chromatic Runs chromatic when label is applied label Jan 21, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jan 21, 2026
@domlander domlander changed the title Limit Front Card videos to an aspect ratio range Render self-hosted videos correctly when there is cropping or letterboxing Jan 21, 2026
@domlander domlander added the run_chromatic Runs chromatic when label is applied label Jan 21, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jan 21, 2026
@domlander domlander added the run_chromatic Runs chromatic when label is applied label Jan 22, 2026
@domlander domlander force-pushed the doml/crop-tall-video branch from eea1927 to ea1a43e Compare January 22, 2026 11:06
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jan 22, 2026
@domlander domlander merged commit de84a94 into main Jan 22, 2026
28 checks passed
@domlander domlander deleted the doml/crop-tall-video branch January 22, 2026 13:59
@gu-prout
Copy link

gu-prout bot commented Jan 22, 2026

Seen on PROD (merged by @domlander 12 minutes and 56 seconds ago) Please check your changes!

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

Labels

fronts + curation maintenance Departmental tracking: maintenance work, not a fix or a feature Seen-on-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants