9uv0f8oll: Fit mobile videos to the screen without cropping
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user