File tree Expand file tree Collapse file tree
src/content/insertable-streams/endtoend-encryption/js Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ let preferredAudioCodecMimeType = 'audio/opus';
4747// eslint-disable-next-line prefer-const
4848let preferredVideoCodecMimeType = 'video/VP8' ;
4949
50+ const supportsSetCodecPreferences = window . RTCRtpTransceiver &&
51+ 'setCodecPreferences' in window . RTCRtpTransceiver . prototype ;
52+
5053let hasEnoughAPIs = ! ! window . RTCRtpScriptTransform ;
5154
5255if ( ! hasEnoughAPIs ) {
@@ -150,7 +153,7 @@ function setupReceiverTransform(receiver) {
150153}
151154
152155function maybeSetCodecPreferences ( trackEvent ) {
153- if ( ! 'setCodecPreferences' in window . RTCRtpTransceiver . prototype ) return ;
156+ if ( ! supportsSetCodecPreferences ) return ;
154157 if ( trackEvent . track . kind === 'audio' && preferredAudioCodecMimeType ) {
155158 const { codecs} = RTCRtpReceiver . getCapabilities ( 'audio' ) ;
156159 const selectedCodecIndex = codecs . findIndex ( c => c . mimeType === preferredAudioCodecMimeType ) ;
You can’t perform that action at this time.
0 commit comments