diff --git a/public/app.js b/public/app.js index 8d5e15a..13baca4 100644 --- a/public/app.js +++ b/public/app.js @@ -49,9 +49,8 @@ socket.on('viewer', id => { .createOffer() .then(sdp => { // Force VP8/H264 on the SDP offer to maximize compatibility with Chromium - const RTCRtpSender = RTCRtpSender || window.RTCRtpSender; - if (RTCRtpSender && RTCRtpSender.getCapabilities) { - const capabilities = RTCRtpSender.getCapabilities('video'); + if (window.RTCRtpSender && window.RTCRtpSender.getCapabilities) { + const capabilities = window.RTCRtpSender.getCapabilities('video'); if (capabilities && capabilities.codecs) { const preferredCodecs = capabilities.codecs.filter(c => c.mimeType.toLowerCase() === 'video/vp8' ||