1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-10 02:35:58 +01:00

Unshare screen when stream ends.

This commit is contained in:
Juliusz Chroboczek 2020-04-25 15:08:18 +02:00
parent b018b14c80
commit 6f7c809b71

View file

@ -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);
} }