瀏覽代碼

fix(TCPUtils): set 'sendrecv' only for the local track

When adjusting transceiver direction only the first one
which corresponds to the local track can be set to 'sendrecv'.
dev1
paweldomas 5 年之前
父節點
當前提交
15a89221bc
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      modules/RTC/TPCUtils.js

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

410
             .filter(t => t.receiver && t.receiver.track && t.receiver.track.kind === mediaType);
410
             .filter(t => t.receiver && t.receiver.track && t.receiver.track.kind === mediaType);
411
         const localTracks = this.pc.getLocalTracks(mediaType);
411
         const localTracks = this.pc.getLocalTracks(mediaType);
412
 
412
 
413
-        transceivers.forEach(transceiver => {
413
+        transceivers.forEach((transceiver, idx) => {
414
             if (active) {
414
             if (active) {
415
-                if (localTracks.length) {
416
-                    // FIXME should adjust only the direction of the local sender or FF will fall into renegotiate loop
415
+                // The first transceiver is for the local track and only this one can be set to 'sendrecv'
416
+                if (idx === 0 && localTracks.length) {
417
                     transceiver.direction = 'sendrecv';
417
                     transceiver.direction = 'sendrecv';
418
                 } else {
418
                 } else {
419
                     transceiver.direction = 'recvonly';
419
                     transceiver.direction = 'recvonly';

Loading…
取消
儲存