Fix HLS video initial aspect on Chrome

Explore videos are very small on Chrome specifically, this has something to do with how the latest version of Chrome loads video metadata. This change provides a default aspect ratio instead of a default height when the container ref is not defined yet
This commit is contained in:
Josh Hawkins 2025-08-27 13:16:43 -05:00
parent 281c461647
commit 74f03b6f95

View File

@ -26,7 +26,7 @@ export function useVideoDimensions(
const videoDimensions = useMemo(() => {
if (!containerWidth || !containerHeight)
return { width: "100%", height: "100%" };
return { aspectRatio: "16 / 9", width: "100%" };
if (containerAspectRatio > videoAspectRatio) {
const height = containerHeight;
const width = height * videoAspectRatio;