Преглед изворни кода

fix(TPCUtils): handle missing codec in isRunningInSimulcastMode.

Aparently we call this for all tracks including for the audio tracks and it is failing with JS error. This leads to "participant unable to unmute".
dev0
Hristo Terezov пре 7 месеци
родитељ
комит
d4a47d0e8a
1 измењених фајлова са 11 додато и 6 уклоњено
  1. 11
    6
      modules/RTC/TPCUtils.js

+ 11
- 6
modules/RTC/TPCUtils.js Прегледај датотеку

@@ -712,20 +712,25 @@ export class TPCUtils {
712 712
      * Returns a boolean indicating whether the video encoder is running in Simulcast mode, i.e., three encodings need
713 713
      * to be configured in 4:2:1 resolution order with temporal scalability.
714 714
      *
715
-     * @param {CodecMimeType} codec - The video codec in use.
715
+     * @param {CodecMimeType} videoCodec - The video codec in use.
716 716
      * @returns {boolean}
717 717
      */
718
-    isRunningInSimulcastMode(codec) {
719
-        return codec === CodecMimeType.VP8 // VP8 always
718
+    isRunningInSimulcastMode(videoCodec) {
719
+        if (!this.codecSettings || !this.codecSettings[videoCodec]) {
720
+            // If codec settings are not available, assume no simulcast
721
+            return false;
722
+        }
723
+
724
+        return videoCodec === CodecMimeType.VP8 // VP8 always
720 725
 
721 726
             // K-SVC mode for VP9 when no scalability mode is set. Though only one outbound-rtp stream is present,
722 727
             // three separate encodings have to be configured.
723
-            || (!this.codecSettings[codec].scalabilityModeEnabled && codec === CodecMimeType.VP9)
728
+            || (!this.codecSettings[videoCodec].scalabilityModeEnabled && videoCodec === CodecMimeType.VP9)
724 729
 
725 730
             // When scalability is enabled, always for H.264, and only when simulcast is explicitly enabled via
726 731
             // config.js for VP9 and AV1 since full SVC is the default mode for these 2 codecs.
727
-            || (this.codecSettings[codec].scalabilityModeEnabled
728
-                && (codec === CodecMimeType.H264 || this.codecSettings[codec].useSimulcast));
732
+            || (this.codecSettings[videoCodec].scalabilityModeEnabled
733
+                && (videoCodec === CodecMimeType.H264 || this.codecSettings[videoCodec].useSimulcast));
729 734
     }
730 735
 
731 736
     /**

Loading…
Откажи
Сачувај