Skip to content

Commit

Permalink
Properly close screenshare on browser stop share popup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Franze authored Feb 2, 2021
1 parent 3aa61fd commit bc7e416
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ui/src/useRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}}));
Expand Down

0 comments on commit bc7e416

Please sign in to comment.