1
Fork 0

Unshare screen when stream ends.

This commit is contained in:
Juliusz Chroboczek 2020-04-25 15:08:18 +02:00
parent b018b14c80
commit 6f7c809b71
1 changed files with 4 additions and 0 deletions

View File

@ -174,6 +174,10 @@ async function setShareMedia() {
c.stream = stream;
stream.getTracks().forEach(t => {
c.pc.addTrack(t, stream);
t.onended = e => {
document.getElementById('sharebox').checked = false;
setShareMedia();
}
});
await setMedia(shareMediaId);
}