From b7f39d3290a53d2c245114fe1510daff2f414b13 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Tue, 27 Apr 2021 17:10:34 +0200 Subject: [PATCH] Remove last traces of onabort callback. Everything now goes through onclose, both for up and down streams. --- README.FRONTEND | 1 - static/protocol.js | 10 +--------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/README.FRONTEND b/README.FRONTEND index 8987caf..81290ab 100644 --- a/README.FRONTEND +++ b/README.FRONTEND @@ -136,7 +136,6 @@ to push a stream to the server. Given a `MediaStream` called `localStream` ```javascript let stream = serverConnection.newUpStream(); stream.onerror = ...; -stream.onabort = ...; stream.onstatus = ...; localStream.getTracks().forEach(t => { c.labels[t.id] = t.kind; diff --git a/static/protocol.js b/static/protocol.js index 89a0795..a80659e 100644 --- a/static/protocol.js +++ b/static/protocol.js @@ -757,8 +757,7 @@ ServerConnection.prototype.gotAbort = function(id) { let c = this.up[id]; if(!c) throw new Error('unknown up stream'); - if(c.onabort) - c.onabort.call(c); + c.close(); }; /** @@ -952,13 +951,6 @@ function Stream(sc, id, localId, pc, up) { * @type{(this: Stream, status: string) => void} */ this.onstatus = null; - /** - * onabort is called when the server requested that an up stream be - * closed. It is the resposibility of the client to close the stream. - * - * @type{(this: Stream) => void} - */ - this.onabort = null; /** * onstats is called when we have new statistics about the connection *