浏览代码

fix(TPC) Do not change the tranceiver dir when the connection is not active.

Fixes https://github.com/jitsi/jitsi-meet/issues/10754.
dev1
Jaya Allamsetty 3 年前
父节点
当前提交
8044345b91
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8
    3
      modules/RTC/TraceablePeerConnection.js

+ 8
- 3
modules/RTC/TraceablePeerConnection.js 查看文件

@@ -2013,9 +2013,14 @@ TraceablePeerConnection.prototype.replaceTrack = function(oldTrack, newTrack) {
2013 2013
             .then(() => {
2014 2014
                 oldTrack && this.localTracks.delete(oldTrack.rtcId);
2015 2015
                 newTrack && this.localTracks.set(newTrack.rtcId, newTrack);
2016
-
2017
-                if (transceiver) {
2018
-                    // Set the transceiver direction.
2016
+                const mediaActive = mediaType === MediaType.AUDIO
2017
+                    ? this.audioTransferActive
2018
+                    : this.videoTransferActive;
2019
+
2020
+                // Set the transceiver direction only if media is not suspended on the connection. This happens when
2021
+                // the client is using the p2p connection. Transceiver direction is updated when media is resumed on
2022
+                // this connection again.
2023
+                if (transceiver && mediaActive) {
2019 2024
                     transceiver.direction = newTrack ? MediaDirection.SENDRECV : MediaDirection.RECVONLY;
2020 2025
                 }
2021 2026
 

正在加载...
取消
保存