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

Implement onnegotiationcompleted callback.

This commit is contained in:
Juliusz Chroboczek 2020-08-26 18:30:29 +02:00
parent 6dc1d72438
commit a4b528e1e7

View file

@ -533,6 +533,8 @@ ServerConnection.prototype.gotOffer = async function(id, labels, offer, renegoti
id: id, id: id,
answer: answer, answer: answer,
}); });
if(c.onnegotiationcompleted)
c.onnegotiationcompleted.call(c);
} }
/** /**
@ -570,6 +572,8 @@ ServerConnection.prototype.gotAnswer = async function(id, answer) {
return; return;
} }
await c.flushIceCandidates(); await c.flushIceCandidates();
if(c.onnegotiationcompleted)
c.onnegotiationcompleted.call(c);
} }
/** /**
@ -739,6 +743,13 @@ function Stream(sc, id, pc) {
* @type{function(any): any} * @type{function(any): any}
*/ */
this.onerror = null; this.onerror = null;
/**
* onnegotiationcompleted is called whenever negotiation or
* renegotiation has completed.
*
* @type{function(): any}
*/
this.onnegotiationcompleted = null;
/** /**
* ondowntrack is called whenever a new track is added to a stream. * ondowntrack is called whenever a new track is added to a stream.
* If the stream parameter differs from its previous value, then it * If the stream parameter differs from its previous value, then it