Browse Source

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'.
master
paweldomas 5 years ago
parent
commit
15a89221bc
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      modules/RTC/TPCUtils.js

+ 3
- 3
modules/RTC/TPCUtils.js View File

@@ -410,10 +410,10 @@ export class TPCUtils {
410 410
             .filter(t => t.receiver && t.receiver.track && t.receiver.track.kind === mediaType);
411 411
         const localTracks = this.pc.getLocalTracks(mediaType);
412 412
 
413
-        transceivers.forEach(transceiver => {
413
+        transceivers.forEach((transceiver, idx) => {
414 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 417
                     transceiver.direction = 'sendrecv';
418 418
                 } else {
419 419
                     transceiver.direction = 'recvonly';

Loading…
Cancel
Save