-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdecoupling.diff
More file actions
71 lines (66 loc) · 1.82 KB
/
Copy pathdecoupling.diff
File metadata and controls
71 lines (66 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
diff --git a/lib/negotiator.ts b/lib/negotiator.ts
index 6f5f462..71b5659 100644
--- a/lib/negotiator.ts
+++ b/lib/negotiator.ts
@@ -37,7 +37,7 @@ export class Negotiator<
const config: RTCDataChannelInit = { ordered: !!options.reliable };
const dataChannel = peerConnection.createDataChannel(
- dataConnection.label,
+ dataConnection.label || "",
config,
);
dataConnection._initializeDataChannel(dataChannel);
diff --git a/lib/supports.ts b/lib/supports.ts
index c06c105..5684e42 100644
--- a/lib/supports.ts
+++ b/lib/supports.ts
@@ -1,9 +1,3 @@
-import webRTCAdapter_import from "webrtc-adapter";
-
-const webRTCAdapter: typeof webRTCAdapter_import =
- //@ts-ignore
- webRTCAdapter_import.default || webRTCAdapter_import;
-
export const Supports = new (class {
readonly isIOS =
typeof navigator !== "undefined"
@@ -36,40 +30,15 @@ export const Supports = new (class {
}
getBrowser(): string {
- return webRTCAdapter.browserDetails.browser;
+ return "chrome";
}
getVersion(): number {
- return webRTCAdapter.browserDetails.version || 0;
+ return this.minChromeVersion;
}
isUnifiedPlanSupported(): boolean {
- const browser = this.getBrowser();
- const version = webRTCAdapter.browserDetails.version || 0;
-
- if (browser === "chrome" && version < this.minChromeVersion) return false;
- if (browser === "firefox" && version >= this.minFirefoxVersion) return true;
- if (
- !window.RTCRtpTransceiver ||
- !("currentDirection" in RTCRtpTransceiver.prototype)
- )
- return false;
-
- let tempPc: RTCPeerConnection;
- let supported = false;
-
- try {
- tempPc = new RTCPeerConnection();
- tempPc.addTransceiver("audio");
- supported = true;
- } catch (e) {
- } finally {
- if (tempPc) {
- tempPc.close();
- }
- }
-
- return supported;
+ return true;
}
toString(): string {