From ad94b040db2c2da631b8aa3356fc7fcd3113347c Mon Sep 17 00:00:00 2001 From: Dawid Sowa Date: Wed, 13 Sep 2023 13:27:41 +0200 Subject: [PATCH] fix: update webrtc polyfill --- src/polyfill.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/polyfill.ts b/src/polyfill.ts index 020d78e..e11a87e 100644 --- a/src/polyfill.ts +++ b/src/polyfill.ts @@ -10,7 +10,7 @@ export const polyfillWebRTC = () => { globalThis.RTCPeerConnection = RTCPeerConnection globalThis.RTCIceCandidate = RTCIceCandidate globalThis.RTCSessionDescription = RTCSessionDescription - } else if (!global.RTCPeerConnection) { + } else if (typeof global !== 'undefined' && !global.RTCPeerConnection) { global.RTCPeerConnection = RTCPeerConnection global.RTCIceCandidate = RTCIceCandidate global.RTCSessionDescription = RTCSessionDescription