Implement abort message in the downstream direction.
This is not quite correct, we're sending a spurious close.
This commit is contained in:
@@ -316,6 +316,9 @@ function serverConnect() {
|
||||
case 'close':
|
||||
gotClose(m.id);
|
||||
break;
|
||||
case 'abort':
|
||||
gotAbort(m.id);
|
||||
break;
|
||||
case 'ice':
|
||||
gotICE(m.id, m.candidate);
|
||||
break;
|
||||
@@ -408,6 +411,24 @@ function gotClose(id) {
|
||||
delMedia(id);
|
||||
}
|
||||
|
||||
function gotAbort(id) {
|
||||
let c = up[id];
|
||||
if(!c)
|
||||
throw new Error('unknown up stream in abort');
|
||||
if(id === localMediaId) {
|
||||
document.getElementById('presenterbox').checked = false;
|
||||
setLocalMedia();
|
||||
} else if(id === shareMediaId) {
|
||||
document.getElementById('sharebox').checked = false;
|
||||
setShareMedia();
|
||||
} else {
|
||||
console.error('Strange stream in abort');
|
||||
delMedia(id);
|
||||
c.pc.close();
|
||||
delete(up[id]);
|
||||
}
|
||||
}
|
||||
|
||||
async function gotICE(id, candidate) {
|
||||
let conn = up[id];
|
||||
if(!conn)
|
||||
|
||||
Reference in New Issue
Block a user