From 23b5468ed48609b6595bd03905d287a92963c13d Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sat, 8 Oct 2022 17:51:12 -0700 Subject: [PATCH] Fix error thrown by player after player is unmounted --- web/components/video/OwncastPlayer/OwncastPlayer.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/components/video/OwncastPlayer/OwncastPlayer.tsx b/web/components/video/OwncastPlayer/OwncastPlayer.tsx index f92ee9c6f..cc3cb0ffe 100644 --- a/web/components/video/OwncastPlayer/OwncastPlayer.tsx +++ b/web/components/video/OwncastPlayer/OwncastPlayer.tsx @@ -288,6 +288,13 @@ export const OwncastPlayer: FC = ({ source, online }) => { } }, [clockSkew]); + useEffect( + () => () => { + stopLatencyCompensator(); + }, + [], + ); + return (
{online && (