|
@@ -559,6 +559,28 @@ export default class JingleSessionPC extends JingleSession {
|
559
|
559
|
}
|
560
|
560
|
};
|
561
|
561
|
|
|
562
|
+
|
|
563
|
+ /**
|
|
564
|
+ * The connection state event is fired whenever the aggregate of underlying
|
|
565
|
+ * transports change their state.
|
|
566
|
+ */
|
|
567
|
+ this.peerconnection.onconnectionstatechange = () => {
|
|
568
|
+ const icestate = this.peerconnection.iceConnectionState;
|
|
569
|
+
|
|
570
|
+ switch (this.peerconnection.connectionState) {
|
|
571
|
+ case 'failed':
|
|
572
|
+ // Since version 76 Chrome no longer switches ICE connection
|
|
573
|
+ // state to failed (see
|
|
574
|
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=982793
|
|
575
|
+ // for details) we use this workaround to recover from lost connections
|
|
576
|
+ if (icestate === 'disconnected') {
|
|
577
|
+ this.room.eventEmitter.emit(
|
|
578
|
+ XMPPEvents.CONNECTION_ICE_FAILED, this);
|
|
579
|
+ }
|
|
580
|
+ break;
|
|
581
|
+ }
|
|
582
|
+ };
|
|
583
|
+
|
562
|
584
|
/**
|
563
|
585
|
* The negotiationneeded event is fired whenever we shake the media on the
|
564
|
586
|
* RTCPeerConnection object.
|