Selaa lähdekoodia

Test RTCRtpReceiver.getCapabilities before using

 RTCRtpReceiver.getCapabilities could be undefined on some platforms
dev1
Jerry Hu 4 vuotta sitten
vanhempi
commit
d12035874f
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1
    0
      modules/RTC/CodecSelection.js

+ 1
- 0
modules/RTC/CodecSelection.js Näytä tiedosto

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

Loading…
Peruuta
Tallenna