Hide video pillarboxing on web when the card fits#11118
Conversation
|
Claude finished @vineyardbovines's task in 2m 5s —— View job Review: Hide video pillarboxing on web when the card fits
Traced the change against Two non-blocking observations, no blockers: 1. One-frame full-bleed flash on every ratio-fit video mount (non-blocking)
Because the outer box height is driven by 2. The always-rendered Verified the blur backdrop is clipped correctly (parent card has |
|
| constrained = Math.max(aspectRatio, ratio) | ||
| } | ||
|
|
||
| const [containerWidth, setContainerWidth] = useState(0) |
There was a problem hiding this comment.
This is a nit, but can we use the aspect ratio to calculate width (constrained by a max height, which I think we do on native) so that we don't need to do a FOUC? Could use a heuristic min window width and fall back to letterbox in those cases.
| {fullBleed && embed.thumbnail && ( | ||
| <div | ||
| aria-hidden | ||
| style={{ | ||
| position: 'absolute', | ||
| inset: 0, | ||
| backgroundImage: `url(${embed.thumbnail})`, | ||
| backgroundSize: 'cover', | ||
| backgroundPosition: 'center', | ||
| filter: 'blur(32px)', | ||
| // hide the transparent fade the blur creates at the edges | ||
| transform: 'scale(1.2)', | ||
| }} | ||
| /> | ||
| )} |
There was a problem hiding this comment.
Love this, looks great imo
On web, videos always rendered as a full-width card with black pillarbox bars around the video. This renders portrait videos at their own aspect ratio (matching native) when the resulting card is wide enough, and softens the bars when it isn't.
Supersedes #10303.
Tested on the web dev server: portrait 1052x1712 renders at its own ratio on desktop and flips to the blurred full-width card below the 280px floor (both directions on window resize), 381x800 (taller than 1:2) keeps the blurred full-width card, landscape unchanged.
before and after