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

Remove streamed video when it finishes.

This commit is contained in:
Juliusz Chroboczek 2020-11-29 22:16:28 +01:00
parent e2a79e24a1
commit 3a86157f15

View file

@ -926,8 +926,15 @@ async function addFileMedia(file) {
}); });
if(sender) { if(sender) {
c.pc.removeTrack(sender) c.pc.removeTrack(sender)
} else } else {
console.warn('Removing unknown track'); console.warn('Removing unknown track');
}
if(Object.keys(c.labels).length === 0) {
stream.onaddtrack = null;
stream.onremovetrack == null;
delUpMedia(c);
}
}; };
setMedia(c, true, video); setMedia(c, true, video);
video.play(); video.play();