Fix HLS video initial aspect on Chrome (#19805)

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:27:18 -05:00 committed by GitHub
parent 281c461647
commit 16b7f7f6e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;