mirror of
https://github.com/screego/server.git
synced 2026-10-31 02:28:17 +08:00
Properly close screenshare on browser stop share popup
This commit is contained in:
@@ -299,6 +299,7 @@ export const useRoom = (): UseRoom => {
|
||||
stream.current = await navigator.mediaDevices
|
||||
// @ts-ignore
|
||||
.getDisplayMedia({video: true});
|
||||
stream.current?.getVideoTracks()[0].addEventListener('ended', () => stopShare());
|
||||
setState((current) => (current ? {...current, hostStream: stream.current} : current));
|
||||
|
||||
conn.current?.send(JSON.stringify({type: 'share', payload: {}}));
|
||||
|
||||
Reference in New Issue
Block a user