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:
@@ -87,11 +87,13 @@ export function PodView({
|
||||
};
|
||||
}, [room, me]);
|
||||
|
||||
// Stop the beat if we leave/unmount.
|
||||
// Stop the beat and any active screen capture on leave/unmount.
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
beatRef.current?.stop();
|
||||
beatRef.current = null;
|
||||
screenTrackRef.current?.stop();
|
||||
screenTrackRef.current = null;
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user