Properly close screenshare on browser stop share popup

This commit is contained in:
Mario Franze
2021-02-02 18:54:47 +00:00
committed by GitHub
parent 3aa61fda11
commit bc7e4166dd
+1
View File
@@ -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: {}}));