diff --git a/static/sfu.js b/static/sfu.js index 3149613..40fa903 100644 --- a/static/sfu.js +++ b/static/sfu.js @@ -926,8 +926,15 @@ async function addFileMedia(file) { }); if(sender) { c.pc.removeTrack(sender) - } else + } else { console.warn('Removing unknown track'); + } + + if(Object.keys(c.labels).length === 0) { + stream.onaddtrack = null; + stream.onremovetrack == null; + delUpMedia(c); + } }; setMedia(c, true, video); video.play();