Просмотр исходного кода

Test RTCRtpReceiver.getCapabilities before using

 RTCRtpReceiver.getCapabilities could be undefined on some platforms
dev1
Jerry Hu 4 лет назад
Родитель
Сommit
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
     }

Загрузка…
Отмена
Сохранить