-
Notifications
You must be signed in to change notification settings - Fork 30
Render self-hosted videos correctly when there is cropping or letterboxing #15119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
af0f861 to
0e435f3
Compare
0e435f3 to
2ab92b7
Compare
bb1033b to
af7f749
Compare
aff35cc to
2f603c3
Compare
abeddow91
approved these changes
Jan 22, 2026
eea1927 to
ea1a43e
Compare
abeddow91
approved these changes
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
SelfHostedVideoisland 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:containerAspectRatioDesktopandcontainerAspectRatioMobilereplacescontainerAspectRatio. 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.letterboxedis replaced byminAspectRatioandmaxAspectRatio. 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.isFeatureCardis 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