Commit 3a86157f authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Remove streamed video when it finishes.

parent e2a79e24
...@@ -926,8 +926,15 @@ async function addFileMedia(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();
......
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