fix(frontend): stop screen MediaStreamTrack on PodView unmount

room.disconnect() removes the participant from LiveKit but doesn't stop
the underlying OS capture. Without track.stop() the screen share indicator
keeps running after Leave. beatRef already had cleanup; add the same for
screenTrackRef.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaCFWMkYQmTcuPsxaaACft
This commit is contained in:
Ramis
2026-06-27 17:34:37 -07:00
parent 59e201fe93
commit 549895292c
+3 -1
View File
@@ -87,11 +87,13 @@ export function PodView({
}; };
}, [room, me]); }, [room, me]);
// Stop the beat if we leave/unmount. // Stop the beat and any active screen capture on leave/unmount.
useEffect(() => { useEffect(() => {
return () => { return () => {
beatRef.current?.stop(); beatRef.current?.stop();
beatRef.current = null; beatRef.current = null;
screenTrackRef.current?.stop();
screenTrackRef.current = null;
}; };
}, []); }, []);