Pārlūkot izejas kodu

fix(p2p) Fix an issue where unmute fails on p2p with channelLastN=0.

Always initiate a sRD->cA->sLD cycle since renegotiation fails in the following scenario.
In a p2p call when channelLastN=0, the direction on the video tranceiver is set to'inactive'.
At this point, if the user unmutes, the track is replaced on the video sender.
If a cO->sLD->sRD is triggered, the browser adds a third m-line which isn't expected and possibly is a bug. All renegotiations fail as a result.
However, the browser does not add a third m-line in the answer it generates and renegotiation succeeds.
tags/v0.0.2
Jaya Allamsetty 2 gadus atpakaļ
vecāks
revīzija
e2b453a248
1 mainītis faili ar 13 papildinājumiem un 1 dzēšanām
  1. 13
    1
      modules/xmpp/JingleSessionPC.js

+ 13
- 1
modules/xmpp/JingleSessionPC.js Parādīt failu

@@ -2395,7 +2395,19 @@ export default class JingleSessionPC extends JingleSession {
2395 2395
                     if (shouldRenegotiate
2396 2396
                         && (oldTrack || newTrack)
2397 2397
                         && this.state === JingleSessionState.ACTIVE) {
2398
-                        promise = this._renegotiate().then(() => {
2398
+                        const remoteSdp = this.peerconnection.remoteDescription.sdp;
2399
+                        const remoteDescription = new RTCSessionDescription({
2400
+                            type: 'offer',
2401
+                            sdp: remoteSdp
2402
+                        });
2403
+
2404
+                        // Always initiate a sRD->cA->sLD cycle since renegotiation fails in the following scenario.
2405
+                        // In a p2p call when channelLastN=0, the direction on the video tranceiver is set to
2406
+                        // 'inactive'. At this point, if the user unmutes, the track is replaced on the video sender.
2407
+                        // If a cO->sLD->sRD is triggered, the browser adds a third m-line which isn't expected and
2408
+                        // possibly is a bug. All renegotiations fail as a result. However, the browser does not add a
2409
+                        // third m-line in the answer it generates and renegotiation succeeds.
2410
+                        promise = this._responderRenegotiate(remoteDescription).then(() => {
2399 2411
                             const newLocalSDP = new SDP(this.peerconnection.localDescription.sdp);
2400 2412
 
2401 2413
                             this.notifyMySSRCUpdate(new SDP(oldLocalSdp), newLocalSDP);

Notiek ielāde…
Atcelt
Saglabāt