Clarify how an invalid width and height manifest

This commit is contained in:
Robin
2026-08-17 11:19:43 +02:00
parent c0d5f2d470
commit 64a5b2ee5c

View File

@@ -15,7 +15,8 @@ export function autoVideoFit(
tileAspectRatio: number,
): "cover" | "contain" {
if (Number.isNaN(videoAspectRatio) || Number.isNaN(tileAspectRatio)) {
// If we have invalid sizes (e.g. width or height is 0), default to cover to avoid black bars.
// If we have invalid sizes (e.g. useMeasure returns 0×0 on an initial render),
// default to cover to avoid black bars.
return "cover";
}