File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/content/insertable-streams/endtoend-encryption/js Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ let preferredAudioCodecMimeType = 'audio/opus';
47
47
// eslint-disable-next-line prefer-const
48
48
let preferredVideoCodecMimeType = 'video/VP8' ;
49
49
50
+ const supportsSetCodecPreferences = window . RTCRtpTransceiver &&
51
+ 'setCodecPreferences' in window . RTCRtpTransceiver . prototype ;
52
+
50
53
let hasEnoughAPIs = ! ! window . RTCRtpScriptTransform ;
51
54
52
55
if ( ! hasEnoughAPIs ) {
@@ -150,7 +153,7 @@ function setupReceiverTransform(receiver) {
150
153
}
151
154
152
155
function maybeSetCodecPreferences ( trackEvent ) {
153
- if ( ! 'setCodecPreferences' in window . RTCRtpTransceiver . prototype ) return ;
156
+ if ( ! supportsSetCodecPreferences ) return ;
154
157
if ( trackEvent . track . kind === 'audio' && preferredAudioCodecMimeType ) {
155
158
const { codecs} = RTCRtpReceiver . getCapabilities ( 'audio' ) ;
156
159
const selectedCodecIndex = codecs . findIndex ( c => c . mimeType === preferredAudioCodecMimeType ) ;
You can’t perform that action at this time.
0 commit comments