Skip to content

Commit

Permalink
fixup! discojs-core: use isomorphic-wrtc
Browse files Browse the repository at this point in the history
  • Loading branch information
tharvik committed Feb 16, 2024
1 parent abe5961 commit 58d6e8f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
22 changes: 21 additions & 1 deletion isomorphic-wrtc/browser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
"use strict";

const getBrowserRTC = require("get-browser-rtc");
// from get-browser-rtc
// TODO move to ES import
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;
}
module.exports = getBrowserRTC();
3 changes: 0 additions & 3 deletions isomorphic-wrtc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@
"license": "MIT",
"peerDependencies": {
"wrtc": "*"
},
"dependencies": {
"get-browser-rtc": "1"
}
}
3 changes: 0 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 58d6e8f

Please sign in to comment.