Skip to content

Support multiple self-hosted videos per MIME type#15545

Merged
domlander merged 2 commits intomainfrom
doml/sh-video-multiple-mp4s
Mar 18, 2026
Merged

Support multiple self-hosted videos per MIME type#15545
domlander merged 2 commits intomainfrom
doml/sh-video-multiple-mp4s

Conversation

@domlander
Copy link
Copy Markdown
Contributor

@domlander domlander commented Mar 17, 2026

What does this change?

Use the largest video per mime type (MP4, M3U8).

Why?

To improve the user experience on mobile, we are transcoding smaller version of self-hosted videos we create and sending the source of this video to DCAR, in addition to the existing, larger one. This PR makes sure that we consistently choose the largest of the files, for when we receive multiple. In a follow-up PR, we will make a decision on what source to use based on the user's browser. However, this will be a touch more complex as ideally it will include a refactor to move dimensions from SelfHostedVideo to Source. This PR is important to ensure we have a consistent experience, by serving the same video each time, in case the tooling work completes before the follow-up PR is ready.

@domlander domlander self-assigned this Mar 17, 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 Mar 17, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Mar 17, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 17, 2026

marginTop: '20px',
}}
>
<p style={{ ...textSans17Object }}>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A drive-by helper for self-hosted video stories. The stories shows a grey square unless the crossOrigin line is commented out

});

it('filters out non-video assets', () => {
it('returns the larger of two MP4 assets', () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the new test. The changes outside of this test are from moving the test objects to the describe level and using them in tests, to reduce duplication

@domlander domlander marked this pull request as ready for review March 18, 2026 09:51
@github-actions
Copy link
Copy Markdown

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.

Comment thread dotcom-rendering/src/model/enhanceCards.ts
@domlander domlander added the run_chromatic Runs chromatic when label is applied label Mar 18, 2026
@domlander domlander requested a review from abeddow91 March 18, 2026 11:47
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Mar 18, 2026
@domlander domlander force-pushed the doml/sh-video-multiple-mp4s branch from 6feff01 to b9affee Compare March 18, 2026 15:25
@domlander domlander added the run_chromatic Runs chromatic when label is applied label Mar 18, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Mar 18, 2026
@domlander domlander merged commit 522e0e7 into main Mar 18, 2026
26 checks passed
@domlander domlander deleted the doml/sh-video-multiple-mp4s branch March 18, 2026 16:25
@gu-prout
Copy link
Copy Markdown

gu-prout Bot commented Mar 18, 2026

Seen on PROD (merged by @domlander 16 minutes and 12 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.

2 participants