mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
15 lines
620 B
JavaScript
15 lines
620 B
JavaScript
// 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
|
|
}
|