fix(player): proper unmount

This commit is contained in:
nick-delirium 2023-04-17 12:35:51 +02:00
parent c92c1a24c1
commit f8f03e5db8
2 changed files with 3 additions and 2 deletions

View file

@ -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(() => {

View file

@ -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()