diff --git a/frontend/app/components/Session/LivePlayer.tsx b/frontend/app/components/Session/LivePlayer.tsx index 060ff1b8f..b73cf4ea9 100644 --- a/frontend/app/components/Session/LivePlayer.tsx +++ b/frontend/app/components/Session/LivePlayer.tsx @@ -71,12 +71,13 @@ function LivePlayer({ return () => { if (!location.pathname.includes('multiview') || !location.pathname.includes(usedSession.sessionId)) { + console.debug('unmount', usedSession.sessionId) playerInst?.clean?.(); // @ts-ignore default empty setContextValue(defaultContextValue) } } - }, [location.pathname]); + }, [location.pathname, usedSession.sessionId]); // LAYOUT (TODO: local layout state - useContext or something..) useEffect(() => { diff --git a/frontend/app/player/web/WebLivePlayer.ts b/frontend/app/player/web/WebLivePlayer.ts index 6bcb20fcb..8753190b5 100644 --- a/frontend/app/player/web/WebLivePlayer.ts +++ b/frontend/app/player/web/WebLivePlayer.ts @@ -90,7 +90,7 @@ export default class WebLivePlayer extends WebPlayer { clean = () => { this.incomingMessages.length = 0 this.assistManager.clean() - this.screen.clean() + this.screen?.clean?.() // @ts-ignore this.screen = undefined; super.clean()