UNPKG

get-browser-rtc

Version:
16 lines (14 loc) 620 B
// originally pulled out of simple-peer module.exports = function getBrowserRTC () { if (typeof globalThis === 'undefined') return null var wrtc = { RTCPeerConnection: globalThis.RTCPeerConnection || globalThis.mozRTCPeerConnection || globalThis.webkitRTCPeerConnection, RTCSessionDescription: globalThis.RTCSessionDescription || globalThis.mozRTCSessionDescription || globalThis.webkitRTCSessionDescription, RTCIceCandidate: globalThis.RTCIceCandidate || globalThis.mozRTCIceCandidate || globalThis.webkitRTCIceCandidate } if (!wrtc.RTCPeerConnection) return null return wrtc }