From b6192c13777e4860d6f7f0837ee7b3b823a2e902 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 15 Mar 2024 17:03:39 -0600 Subject: [PATCH] Improve consistency of video scaling --- web/src/components/player/HlsVideoPlayer.tsx | 6 +++-- .../player/dynamic/DynamicVideoPlayer.tsx | 23 ++++++++++++------- web/src/views/events/RecordingView.tsx | 2 +- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/web/src/components/player/HlsVideoPlayer.tsx b/web/src/components/player/HlsVideoPlayer.tsx index 4492bae43..fd0e79db0 100644 --- a/web/src/components/player/HlsVideoPlayer.tsx +++ b/web/src/components/player/HlsVideoPlayer.tsx @@ -59,6 +59,7 @@ export default function HlsVideoPlayer({ const hlsRef = useRef(); const [useHlsCompat, setUseHlsCompat] = useState(false); + const [loadedMetadata, setLoadedMetadata] = useState(false); useEffect(() => { if (!videoRef.current) { @@ -153,7 +154,7 @@ export default function HlsVideoPlayer({ return (
{ @@ -174,7 +175,7 @@ export default function HlsVideoPlayer({
2) { return "wide"; - } else if (aspectRatio < 1) { + } else if (aspectRatio < 16 / 9) { return "tall"; } else { return "normal";