Преглед на файлове

Test RTCRtpReceiver.getCapabilities before using

 RTCRtpReceiver.getCapabilities could be undefined on some platforms
dev1
Jerry Hu преди 4 години
родител
ревизия
d12035874f
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1
    0
      modules/RTC/CodecSelection.js

+ 1
- 0
modules/RTC/CodecSelection.js Целия файл

@@ -94,6 +94,7 @@ export class CodecSelection {
94 94
         }
95 95
 
96 96
         return window.RTCRtpReceiver
97
+            && window.RTCRtpReceiver.getCapabilities
97 98
             && window.RTCRtpReceiver.getCapabilities('video').codecs
98 99
             .some(codec => codec.mimeType.toLowerCase() === `video/${preferredCodec}`);
99 100
     }

Loading…
Отказ
Запис