refactor: remove redundant RTCRtpSender variable declaration and directly use window.RTCRtpSender.
This commit is contained in:
@@ -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' ||
|
||||
|
||||
Reference in New Issue
Block a user