fix(player): proper unmount
This commit is contained in:
parent
c92c1a24c1
commit
f8f03e5db8
2 changed files with 3 additions and 2 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue