浏览代码

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 年前
父节点
当前提交
e2b453a248
共有 1 个文件被更改,包括 13 次插入1 次删除
  1. 13
    1
      modules/xmpp/JingleSessionPC.js

+ 13
- 1
modules/xmpp/JingleSessionPC.js 查看文件

@@ -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);

正在加载...
取消
保存