Procházet zdrojové kódy

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 před 5 roky
rodič
revize
15a89221bc
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 3
    3
      modules/RTC/TPCUtils.js

+ 3
- 3
modules/RTC/TPCUtils.js Zobrazit soubor

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

Načítá se…
Zrušit
Uložit