9uv0f8oll: Fit mobile videos to the screen without cropping

This commit is contained in:
2026-10-20 09:59:38 -06:00
parent c4434198ad
commit d653e8e75d
7 changed files with 114 additions and 10 deletions
+11
View File
@@ -195,3 +195,14 @@ describe("top bar and progress rail", () => {
expect(css).toMatch(/\.ph-top \{[^}]*safe-area-inset-top/);
});
});
describe("videoFit", () => {
it("fills the slide for 4:5 and taller, shows whole for wider, covers while unknown", async () => {
const { videoFit } = await import("@/components/MobileFeed");
expect(videoFit(720, 1280)).toBe("cover");
expect(videoFit(1080, 1350)).toBe("cover");
expect(videoFit(1080, 1080)).toBe("contain");
expect(videoFit(1920, 1080)).toBe("contain");
expect(videoFit(0, 0)).toBe("cover");
});
});