Commit 6f7c809b authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Unshare screen when stream ends.

parent b018b14c
...@@ -174,6 +174,10 @@ async function setShareMedia() { ...@@ -174,6 +174,10 @@ async function setShareMedia() {
c.stream = stream; c.stream = stream;
stream.getTracks().forEach(t => { stream.getTracks().forEach(t => {
c.pc.addTrack(t, stream); c.pc.addTrack(t, stream);
t.onended = e => {
document.getElementById('sharebox').checked = false;
setShareMedia();
}
}); });
await setMedia(shareMediaId); await setMedia(shareMediaId);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment