mirror of
https://github.com/jech/galene.git
synced 2024-11-25 18:15:57 +01:00
Allow renegotiate to be called on down streams.
This commit is contained in:
parent
f002a83806
commit
c6108f08d5
1 changed files with 16 additions and 8 deletions
|
@ -569,7 +569,8 @@ ServerConnection.prototype.gotOffer = async function(id, labels, offer, renegoti
|
||||||
if(c.onstatus)
|
if(c.onstatus)
|
||||||
c.onstatus.call(c, pc.iceConnectionState);
|
c.onstatus.call(c, pc.iceConnectionState);
|
||||||
if(pc.iceConnectionState === 'failed') {
|
if(pc.iceConnectionState === 'failed') {
|
||||||
sc.send({type: 'renegotiate',
|
sc.send({
|
||||||
|
type: 'renegotiate',
|
||||||
id: id,
|
id: id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1026,15 +1027,22 @@ Stream.prototype.negotiate = async function (restartIce) {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* restartIce causes an ICE restart on an up stream. It is called
|
* restartIce causes an ICE restart on a stream. For up streams, it is
|
||||||
* automatically when ICE signals that the connection has failed. It
|
* called automatically when ICE signals that the connection has failed,
|
||||||
* returns immediately, negotiation will happen asynchronously.
|
* but may also be called by the application. For down streams, it
|
||||||
|
* requests that the server perform an ICE restart. In either case,
|
||||||
|
* it returns immediately, negotiation will happen asynchronously.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Stream.prototype.restartIce = function () {
|
Stream.prototype.restartIce = function () {
|
||||||
let c = this;
|
let c = this;
|
||||||
if(!c.up)
|
if(!c.up) {
|
||||||
throw new Error('not an up stream');
|
c.sc.send({
|
||||||
|
type: 'renegotiate',
|
||||||
|
id: c.id,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if('restartIce' in c.pc) {
|
if('restartIce' in c.pc) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue