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()
|
.createOffer()
|
||||||
.then(sdp => {
|
.then(sdp => {
|
||||||
// Force VP8/H264 on the SDP offer to maximize compatibility with Chromium
|
// Force VP8/H264 on the SDP offer to maximize compatibility with Chromium
|
||||||
const RTCRtpSender = RTCRtpSender || window.RTCRtpSender;
|
if (window.RTCRtpSender && window.RTCRtpSender.getCapabilities) {
|
||||||
if (RTCRtpSender && RTCRtpSender.getCapabilities) {
|
const capabilities = window.RTCRtpSender.getCapabilities('video');
|
||||||
const capabilities = RTCRtpSender.getCapabilities('video');
|
|
||||||
if (capabilities && capabilities.codecs) {
|
if (capabilities && capabilities.codecs) {
|
||||||
const preferredCodecs = capabilities.codecs.filter(c =>
|
const preferredCodecs = capabilities.codecs.filter(c =>
|
||||||
c.mimeType.toLowerCase() === 'video/vp8' ||
|
c.mimeType.toLowerCase() === 'video/vp8' ||
|
||||||
|
|||||||
Reference in New Issue
Block a user