sip-connector 12.2.0 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{SipConnector-BxDInUHC.js → SipConnector-B4xLnl6L.js} +284 -278
- package/dist/SipConnector-CE4F15z6.cjs +1 -0
- package/dist/SipConnector.d.ts +9 -17
- package/dist/SipConnectorFacade/SipConnectorFacade.d.ts +28 -1
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +373 -336
- package/dist/tools/prepareMediaStream.d.ts +3 -3
- package/package.json +6 -6
- package/dist/SipConnector-Ds1fhzNg.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { B as
|
|
5
|
-
import { i as
|
|
6
|
-
import { sequentPromises as
|
|
7
|
-
import { createStackPromises as
|
|
8
|
-
import { isCanceledError as
|
|
9
|
-
import { hasCanceledError as
|
|
10
|
-
import { debounce as
|
|
11
|
-
import { default as
|
|
12
|
-
const
|
|
1
|
+
var se = Object.defineProperty;
|
|
2
|
+
var oe = (n, e, t) => e in n ? se(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var u = (n, e, t) => oe(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { B as G, N as K, l as a, E as L, s as re, a as ie, P as ce, b as ae, S as tn } from "./SipConnector-B4xLnl6L.js";
|
|
5
|
+
import { i as Cn, j as fn, m as mn, k as Rn, c as gn, d as pn, f as yn, g as Tn, e as En, h as bn } from "./SipConnector-B4xLnl6L.js";
|
|
6
|
+
import { sequentPromises as ue } from "sequent-promises";
|
|
7
|
+
import { createStackPromises as de } from "stack-promises";
|
|
8
|
+
import { isCanceledError as le } from "@krivega/cancelable-promise";
|
|
9
|
+
import { hasCanceledError as Se } from "repeated-calls";
|
|
10
|
+
import { debounce as he } from "ts-debounce";
|
|
11
|
+
import { default as An } from "debug";
|
|
12
|
+
const H = (n) => {
|
|
13
13
|
const { url: e, cause: t } = n;
|
|
14
14
|
let s = e;
|
|
15
|
-
return (t ===
|
|
15
|
+
return (t === G || t === K) && (s = `${n.message.to.uri.user}@${n.message.to.uri.host}`), s;
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
const
|
|
19
|
-
var
|
|
17
|
+
var q = /* @__PURE__ */ ((n) => (n.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", n.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", n.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", n.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", n.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", n.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", n))(q || {});
|
|
18
|
+
const Ce = (n = new Error()) => {
|
|
19
|
+
var o;
|
|
20
20
|
const { cause: e, socket: t } = n;
|
|
21
21
|
let s = "CONNECT_SERVER_FAILED";
|
|
22
22
|
switch (e) {
|
|
@@ -24,19 +24,19 @@ const le = (n = new Error()) => {
|
|
|
24
24
|
s = "WRONG_USER_OR_PASSWORD";
|
|
25
25
|
break;
|
|
26
26
|
}
|
|
27
|
-
case
|
|
27
|
+
case G: {
|
|
28
28
|
s = "BAD_MEDIA_ERROR";
|
|
29
29
|
break;
|
|
30
30
|
}
|
|
31
|
-
case
|
|
31
|
+
case K: {
|
|
32
32
|
s = "NOT_FOUND_ERROR";
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
35
35
|
default:
|
|
36
|
-
t && ((
|
|
36
|
+
t && ((o = t == null ? void 0 : t._ws) == null ? void 0 : o.readyState) === 3 ? s = "WS_CONNECTION_FAILED" : H(n) && (s = "CONNECT_SERVER_FAILED_BY_LINK");
|
|
37
37
|
}
|
|
38
38
|
return s;
|
|
39
|
-
},
|
|
39
|
+
}, fe = (n) => {
|
|
40
40
|
let e = "";
|
|
41
41
|
try {
|
|
42
42
|
e = JSON.stringify(n);
|
|
@@ -44,190 +44,190 @@ const le = (n = new Error()) => {
|
|
|
44
44
|
a("failed to stringify message", t);
|
|
45
45
|
}
|
|
46
46
|
return e;
|
|
47
|
-
},
|
|
48
|
-
const { code: e, cause: t, message: s } = n,
|
|
49
|
-
return typeof s == "object" && s !== null ?
|
|
50
|
-
},
|
|
47
|
+
}, me = (n = new Error()) => {
|
|
48
|
+
const { code: e, cause: t, message: s } = n, o = H(n), r = { code: "", cause: "", message: "" };
|
|
49
|
+
return typeof s == "object" && s !== null ? r.message = fe(s) : s && (r.message = String(s)), o && (r.link = o), e && (r.code = e), t && (r.cause = t), r;
|
|
50
|
+
}, Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
51
51
|
__proto__: null,
|
|
52
|
-
EErrorTypes:
|
|
53
|
-
getLinkError:
|
|
54
|
-
getTypeFromError:
|
|
55
|
-
getValuesFromError:
|
|
56
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
52
|
+
EErrorTypes: q,
|
|
53
|
+
getLinkError: H,
|
|
54
|
+
getTypeFromError: Ce,
|
|
55
|
+
getValuesFromError: me
|
|
56
|
+
}, Symbol.toStringTag, { value: "Module" })), ge = ({
|
|
57
57
|
sessionId: n,
|
|
58
58
|
remoteAddress: e,
|
|
59
59
|
isMutedAudio: t,
|
|
60
60
|
isMutedVideo: s,
|
|
61
|
-
isRegistered:
|
|
62
|
-
isPresentationCall:
|
|
61
|
+
isRegistered: o,
|
|
62
|
+
isPresentationCall: r
|
|
63
63
|
}) => {
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
},
|
|
64
|
+
const i = [], c = t ? "0" : "1", d = s ? "0" : "1";
|
|
65
|
+
return i.push(`X-Vinteo-Mic-State: ${c}`, `X-Vinteo-MainCam-State: ${d}`), o || i.push("X-Vinteo-Purgatory-Call: yes"), n && i.push(`X-Vinteo-Session: ${n}`), r && i.push("X-Vinteo-Presentation-Call: yes"), e && i.push(`X-Vinteo-Remote: ${e}`), i;
|
|
66
|
+
}, pe = "[@*!|]", ye = "_", Te = (n) => {
|
|
67
67
|
let e = n;
|
|
68
|
-
return e = e.replaceAll(new RegExp(
|
|
69
|
-
},
|
|
68
|
+
return e = e.replaceAll(new RegExp(pe, "g"), ye), e;
|
|
69
|
+
}, Ee = ({
|
|
70
70
|
appName: n,
|
|
71
71
|
appVersion: e,
|
|
72
72
|
browserName: t,
|
|
73
73
|
browserVersion: s
|
|
74
74
|
}) => {
|
|
75
|
-
const
|
|
76
|
-
return `ChromeNew - ${t ? `${t} ${s}, ${
|
|
77
|
-
},
|
|
75
|
+
const r = `${Te(n)} ${e}`;
|
|
76
|
+
return `ChromeNew - ${t ? `${t} ${s}, ${r}` : r}`;
|
|
77
|
+
}, be = ({
|
|
78
78
|
isUnifiedSdpSemantic: n,
|
|
79
79
|
appVersion: e,
|
|
80
80
|
browserName: t,
|
|
81
81
|
browserVersion: s,
|
|
82
|
-
appName:
|
|
83
|
-
}) => n ?
|
|
82
|
+
appName: o
|
|
83
|
+
}) => n ? Ee({ appVersion: e, browserName: t, browserVersion: s, appName: o }) : "Chrome", Y = "purgatory", D = (n) => n === Y, Me = (n) => (e) => [...e].map((s) => async () => n(s)), Ae = async ({
|
|
84
84
|
accumulatedKeys: n,
|
|
85
85
|
sendKey: e,
|
|
86
86
|
canRunTask: t
|
|
87
87
|
}) => {
|
|
88
|
-
const
|
|
89
|
-
return
|
|
90
|
-
},
|
|
91
|
-
const e = (f,
|
|
92
|
-
if (
|
|
88
|
+
const o = Me(e)(n);
|
|
89
|
+
return ue(o, t);
|
|
90
|
+
}, _e = (n) => (t) => (a("onStartMainCam"), n.onSession("admin-start-main-cam", t)), ve = (n) => (t) => (a("onStartMic"), n.onSession("admin-start-mic", t)), Oe = (n) => (t) => (a("onStopMainCam"), n.onSession("admin-stop-main-cam", t)), Ne = (n) => (t) => (a("onStopMic"), n.onSession("admin-stop-mic", t)), we = ({ sipConnector: n }) => {
|
|
91
|
+
const e = (f, p) => ({ isSyncForced: m = !1 }) => {
|
|
92
|
+
if (m) {
|
|
93
93
|
f();
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
}, t =
|
|
98
|
-
let
|
|
99
|
-
},
|
|
100
|
-
},
|
|
96
|
+
p();
|
|
97
|
+
}, t = _e(n), s = Oe(n), o = ve(n), r = Ne(n);
|
|
98
|
+
let i = () => {
|
|
99
|
+
}, c = () => {
|
|
100
|
+
}, d = () => {
|
|
101
101
|
}, S = () => {
|
|
102
102
|
};
|
|
103
103
|
const C = ({
|
|
104
104
|
onStartMainCamForced: f,
|
|
105
|
-
onStartMainCamNotForced:
|
|
106
|
-
onStopMainCamForced:
|
|
107
|
-
onStopMainCamNotForced:
|
|
108
|
-
onStartMicForced:
|
|
109
|
-
onStartMicNotForced:
|
|
110
|
-
onStopMicForced:
|
|
111
|
-
onStopMicNotForced:
|
|
105
|
+
onStartMainCamNotForced: p,
|
|
106
|
+
onStopMainCamForced: m,
|
|
107
|
+
onStopMainCamNotForced: R,
|
|
108
|
+
onStartMicForced: y,
|
|
109
|
+
onStartMicNotForced: T,
|
|
110
|
+
onStopMicForced: E,
|
|
111
|
+
onStopMicNotForced: b
|
|
112
112
|
}) => {
|
|
113
|
-
const
|
|
113
|
+
const _ = e(
|
|
114
114
|
f,
|
|
115
|
-
|
|
115
|
+
p
|
|
116
116
|
);
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
i = t(_);
|
|
118
|
+
const v = e(
|
|
119
|
+
m,
|
|
120
|
+
R
|
|
121
121
|
);
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
S =
|
|
127
|
-
},
|
|
128
|
-
|
|
122
|
+
c = s(v);
|
|
123
|
+
const O = e(y, T);
|
|
124
|
+
d = o(O);
|
|
125
|
+
const N = e(E, b);
|
|
126
|
+
S = r(N);
|
|
127
|
+
}, h = () => {
|
|
128
|
+
i(), c(), d(), S();
|
|
129
129
|
};
|
|
130
130
|
return {
|
|
131
131
|
start: (f) => {
|
|
132
132
|
C(f);
|
|
133
133
|
},
|
|
134
134
|
stop: () => {
|
|
135
|
-
|
|
135
|
+
h();
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
|
-
},
|
|
138
|
+
}, un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
139
139
|
__proto__: null,
|
|
140
|
-
PURGATORY_CONFERENCE_NUMBER:
|
|
141
|
-
createSyncMediaState:
|
|
142
|
-
error:
|
|
143
|
-
getExtraHeaders:
|
|
144
|
-
getUserAgent:
|
|
145
|
-
hasPurgatory:
|
|
146
|
-
sendDTMFAccumulated:
|
|
147
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
148
|
-
const t =
|
|
140
|
+
PURGATORY_CONFERENCE_NUMBER: Y,
|
|
141
|
+
createSyncMediaState: we,
|
|
142
|
+
error: Re,
|
|
143
|
+
getExtraHeaders: ge,
|
|
144
|
+
getUserAgent: be,
|
|
145
|
+
hasPurgatory: D,
|
|
146
|
+
sendDTMFAccumulated: Ae
|
|
147
|
+
}, Symbol.toStringTag, { value: "Module" })), Be = (n) => [...n.keys()].map((e) => n.get(e)), Pe = (n, e) => Be(n).find((t) => t.type === e), De = async (n) => n.getStats().then((e) => {
|
|
148
|
+
const t = Pe(e, "codec");
|
|
149
149
|
return t == null ? void 0 : t.mimeType;
|
|
150
|
-
}),
|
|
150
|
+
}), Ie = (n) => n.find((e) => {
|
|
151
151
|
var t;
|
|
152
152
|
return ((t = e == null ? void 0 : e.track) == null ? void 0 : t.kind) === "video";
|
|
153
|
-
}),
|
|
154
|
-
const t =
|
|
155
|
-
return
|
|
156
|
-
},
|
|
153
|
+
}), z = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), Fe = 1e6, g = (n) => n * Fe, Q = g(0.06), ke = g(4), Ue = (n) => n <= 64 ? Q : n <= 128 ? g(0.12) : n <= 256 ? g(0.25) : n <= 384 ? g(0.32) : n <= 426 ? g(0.38) : n <= 640 ? g(0.5) : n <= 848 ? g(0.7) : n <= 1280 ? g(1) : n <= 1920 ? g(2) : ke, Ve = "av1", Le = (n) => z(n, Ve), xe = 0.6, J = (n, e) => Le(e) ? n * xe : n, $e = (n) => J(Q, n), Z = (n, e) => {
|
|
154
|
+
const t = Ue(n);
|
|
155
|
+
return J(t, e);
|
|
156
|
+
}, He = 1, ee = ({
|
|
157
157
|
videoTrack: n,
|
|
158
158
|
targetSize: e,
|
|
159
159
|
codec: t
|
|
160
160
|
}) => {
|
|
161
|
-
const s = n.getSettings(),
|
|
162
|
-
return { scaleResolutionDownBy:
|
|
163
|
-
},
|
|
161
|
+
const s = n.getSettings(), o = s.width, r = s.height, i = o / e.width, c = r / e.height, d = Math.max(i, c, He), S = Z(e.width, t);
|
|
162
|
+
return { scaleResolutionDownBy: d, maxBitrate: S };
|
|
163
|
+
}, ne = de(), Xe = async () => ne().catch((n) => {
|
|
164
164
|
a("videoSendingBalancer: error", n);
|
|
165
|
-
}),
|
|
165
|
+
}), je = async (n) => (ne.add(n), Xe()), X = async ({
|
|
166
166
|
sender: n,
|
|
167
167
|
scaleResolutionDownBy: e,
|
|
168
168
|
maxBitrate: t,
|
|
169
169
|
onSetParameters: s
|
|
170
|
-
}) =>
|
|
171
|
-
const
|
|
172
|
-
return
|
|
170
|
+
}) => je(async () => re(n, { scaleResolutionDownBy: e, maxBitrate: t }, s)), We = async ({ sender: n, codec: e }, t) => {
|
|
171
|
+
const o = $e(e);
|
|
172
|
+
return X({
|
|
173
173
|
sender: n,
|
|
174
|
-
maxBitrate:
|
|
174
|
+
maxBitrate: o,
|
|
175
175
|
onSetParameters: t,
|
|
176
176
|
scaleResolutionDownBy: 200
|
|
177
177
|
});
|
|
178
|
-
},
|
|
178
|
+
}, x = async ({
|
|
179
179
|
sender: n,
|
|
180
180
|
videoTrack: e,
|
|
181
181
|
codec: t
|
|
182
182
|
}, s) => {
|
|
183
|
-
const
|
|
184
|
-
return
|
|
183
|
+
const i = e.getSettings().width, c = Z(i, t);
|
|
184
|
+
return X({
|
|
185
185
|
sender: n,
|
|
186
|
-
maxBitrate:
|
|
186
|
+
maxBitrate: c,
|
|
187
187
|
onSetParameters: s,
|
|
188
188
|
scaleResolutionDownBy: 1
|
|
189
189
|
});
|
|
190
|
-
},
|
|
190
|
+
}, Ge = async ({
|
|
191
191
|
sender: n,
|
|
192
192
|
videoTrack: e,
|
|
193
193
|
resolution: t,
|
|
194
194
|
codec: s
|
|
195
|
-
},
|
|
196
|
-
const [
|
|
195
|
+
}, o) => {
|
|
196
|
+
const [r, i] = t.split("x"), { maxBitrate: c, scaleResolutionDownBy: d } = ee({
|
|
197
197
|
videoTrack: e,
|
|
198
198
|
codec: s,
|
|
199
199
|
targetSize: {
|
|
200
|
-
width: Number(
|
|
201
|
-
height: Number(
|
|
200
|
+
width: Number(r),
|
|
201
|
+
height: Number(i)
|
|
202
202
|
}
|
|
203
203
|
});
|
|
204
|
-
return
|
|
204
|
+
return X({
|
|
205
205
|
sender: n,
|
|
206
|
-
maxBitrate:
|
|
207
|
-
onSetParameters:
|
|
208
|
-
scaleResolutionDownBy:
|
|
206
|
+
maxBitrate: c,
|
|
207
|
+
onSetParameters: o,
|
|
208
|
+
scaleResolutionDownBy: d
|
|
209
209
|
});
|
|
210
|
-
},
|
|
210
|
+
}, Ke = async ({
|
|
211
211
|
mainCam: n,
|
|
212
212
|
resolutionMainCam: e,
|
|
213
213
|
sender: t,
|
|
214
214
|
videoTrack: s,
|
|
215
|
-
codec:
|
|
216
|
-
},
|
|
215
|
+
codec: o
|
|
216
|
+
}, r) => {
|
|
217
217
|
switch (n) {
|
|
218
|
-
case
|
|
219
|
-
return
|
|
220
|
-
case
|
|
221
|
-
return
|
|
222
|
-
case
|
|
223
|
-
return e !== void 0 ?
|
|
224
|
-
{ sender: t, videoTrack: s, codec:
|
|
225
|
-
|
|
226
|
-
) :
|
|
218
|
+
case L.PAUSE_MAIN_CAM:
|
|
219
|
+
return We({ sender: t, codec: o }, r);
|
|
220
|
+
case L.RESUME_MAIN_CAM:
|
|
221
|
+
return x({ sender: t, videoTrack: s, codec: o }, r);
|
|
222
|
+
case L.MAX_MAIN_CAM_RESOLUTION:
|
|
223
|
+
return e !== void 0 ? Ge(
|
|
224
|
+
{ sender: t, videoTrack: s, codec: o, resolution: e },
|
|
225
|
+
r
|
|
226
|
+
) : x({ sender: t, videoTrack: s, codec: o }, r);
|
|
227
227
|
default:
|
|
228
|
-
return
|
|
228
|
+
return x({ sender: t, videoTrack: s, codec: o }, r);
|
|
229
229
|
}
|
|
230
|
-
},
|
|
230
|
+
}, j = {
|
|
231
231
|
isChanged: !1,
|
|
232
232
|
parameters: {
|
|
233
233
|
encodings: [{}],
|
|
@@ -236,167 +236,189 @@ const le = (n = new Error()) => {
|
|
|
236
236
|
headerExtensions: [],
|
|
237
237
|
rtcp: {}
|
|
238
238
|
}
|
|
239
|
-
},
|
|
239
|
+
}, W = async ({
|
|
240
240
|
mainCam: n,
|
|
241
241
|
resolutionMainCam: e,
|
|
242
242
|
connection: t,
|
|
243
243
|
onSetParameters: s,
|
|
244
|
-
ignoreForCodec:
|
|
244
|
+
ignoreForCodec: o
|
|
245
245
|
}) => {
|
|
246
|
-
const
|
|
247
|
-
if (!(
|
|
248
|
-
return
|
|
249
|
-
const
|
|
250
|
-
return
|
|
246
|
+
const r = t.getSenders(), i = Ie(r);
|
|
247
|
+
if (!(i != null && i.track))
|
|
248
|
+
return j;
|
|
249
|
+
const c = await De(i);
|
|
250
|
+
return z(c, o) ? j : Ke(
|
|
251
251
|
{
|
|
252
252
|
mainCam: n,
|
|
253
253
|
resolutionMainCam: e,
|
|
254
|
-
sender:
|
|
255
|
-
codec:
|
|
256
|
-
videoTrack:
|
|
254
|
+
sender: i,
|
|
255
|
+
codec: c,
|
|
256
|
+
videoTrack: i.track
|
|
257
257
|
},
|
|
258
258
|
s
|
|
259
259
|
);
|
|
260
|
-
},
|
|
260
|
+
}, dn = (n, {
|
|
261
261
|
ignoreForCodec: e,
|
|
262
262
|
onSetParameters: t
|
|
263
263
|
} = {}) => {
|
|
264
264
|
const s = async () => {
|
|
265
|
-
const { connection:
|
|
266
|
-
if (!
|
|
265
|
+
const { connection: d } = n;
|
|
266
|
+
if (!d)
|
|
267
267
|
throw new Error("connection is not exist");
|
|
268
|
-
return
|
|
269
|
-
connection:
|
|
268
|
+
return W({
|
|
269
|
+
connection: d,
|
|
270
270
|
onSetParameters: t,
|
|
271
271
|
ignoreForCodec: e
|
|
272
272
|
});
|
|
273
273
|
};
|
|
274
|
-
let
|
|
275
|
-
const
|
|
276
|
-
const { mainCam: S, resolutionMainCam: C } =
|
|
277
|
-
if (!
|
|
274
|
+
let o = s;
|
|
275
|
+
const r = async (d) => (o = async () => {
|
|
276
|
+
const { mainCam: S, resolutionMainCam: C } = d, { connection: h } = n;
|
|
277
|
+
if (!h)
|
|
278
278
|
throw new Error("connection is not exist");
|
|
279
|
-
return
|
|
279
|
+
return W({
|
|
280
280
|
mainCam: S,
|
|
281
281
|
resolutionMainCam: C,
|
|
282
|
-
connection:
|
|
282
|
+
connection: h,
|
|
283
283
|
onSetParameters: t,
|
|
284
284
|
ignoreForCodec: e
|
|
285
285
|
});
|
|
286
|
-
},
|
|
286
|
+
}, o());
|
|
287
287
|
return {
|
|
288
288
|
subscribe: () => {
|
|
289
|
-
n.onSession("main-cam-control",
|
|
289
|
+
n.onSession("main-cam-control", r);
|
|
290
290
|
},
|
|
291
291
|
unsubscribe: () => {
|
|
292
|
-
n.offSession("main-cam-control",
|
|
292
|
+
n.offSession("main-cam-control", r);
|
|
293
293
|
},
|
|
294
294
|
balanceByTrack: s,
|
|
295
295
|
resetMainCamControl() {
|
|
296
|
-
|
|
296
|
+
o = s;
|
|
297
297
|
},
|
|
298
298
|
async reBalance() {
|
|
299
|
-
return
|
|
299
|
+
return o();
|
|
300
300
|
}
|
|
301
301
|
};
|
|
302
|
-
},
|
|
302
|
+
}, qe = (n) => n.getVideoTracks()[0], B = ({
|
|
303
303
|
mediaStream: n,
|
|
304
304
|
simulcastEncodings: e,
|
|
305
305
|
sendEncodings: t
|
|
306
306
|
}) => {
|
|
307
307
|
if (e && e.length > 0) {
|
|
308
|
-
const s = t ?? [],
|
|
309
|
-
return e.forEach((
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
const { maxBitrate:
|
|
313
|
-
videoTrack:
|
|
308
|
+
const s = t ?? [], o = qe(n);
|
|
309
|
+
return e.forEach((r, i) => {
|
|
310
|
+
const c = s[i] ?? {};
|
|
311
|
+
c.active = !0, r.rid !== void 0 && (c.rid = r.rid), r.scalabilityMode !== void 0 && (c.scalabilityMode = r.scalabilityMode);
|
|
312
|
+
const { maxBitrate: d, scaleResolutionDownBy: S } = ee({
|
|
313
|
+
videoTrack: o,
|
|
314
314
|
targetSize: {
|
|
315
|
-
width:
|
|
316
|
-
height:
|
|
315
|
+
width: r.width,
|
|
316
|
+
height: r.height
|
|
317
317
|
}
|
|
318
318
|
});
|
|
319
|
-
|
|
319
|
+
c.maxBitrate = d, c.scaleResolutionDownBy = S, s[i] = c;
|
|
320
320
|
}), s;
|
|
321
321
|
}
|
|
322
322
|
return t;
|
|
323
|
-
},
|
|
324
|
-
const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs,
|
|
325
|
-
return
|
|
326
|
-
},
|
|
327
|
-
const
|
|
328
|
-
return
|
|
329
|
-
}),
|
|
323
|
+
}, Ye = (n, e) => [...n, ...e].filter((o, r, i) => r === i.findIndex((c) => c.clockRate === o.clockRate && c.mimeType === o.mimeType && c.channels === o.channels && c.sdpFmtpLine === o.sdpFmtpLine)), ze = (n) => {
|
|
324
|
+
const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs, o = t === null ? [] : t.codecs;
|
|
325
|
+
return Ye(s, o);
|
|
326
|
+
}, Qe = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
|
|
327
|
+
const o = e.indexOf(t.mimeType), r = e.indexOf(s.mimeType), i = o === -1 ? Number.MAX_VALUE : o, c = r === -1 ? Number.MAX_VALUE : r;
|
|
328
|
+
return i - c;
|
|
329
|
+
}), Je = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), P = (n, {
|
|
330
330
|
preferredMimeTypesVideoCodecs: e,
|
|
331
331
|
excludeMimeTypesVideoCodecs: t
|
|
332
332
|
}) => async (s) => {
|
|
333
|
-
var
|
|
334
|
-
if (typeof s.setCodecPreferences == "function" && ((
|
|
335
|
-
const
|
|
336
|
-
s.setCodecPreferences(
|
|
333
|
+
var o;
|
|
334
|
+
if (typeof s.setCodecPreferences == "function" && ((o = s.sender.track) == null ? void 0 : o.kind) === "video" && (e !== void 0 && (e == null ? void 0 : e.length) > 0 || t !== void 0 && (t == null ? void 0 : t.length) > 0)) {
|
|
335
|
+
const r = ze("video"), i = Je(r, t), c = Qe(i, e);
|
|
336
|
+
s.setCodecPreferences(c);
|
|
337
337
|
}
|
|
338
|
-
Object.keys(n).length > 0 && await
|
|
339
|
-
},
|
|
340
|
-
if (!
|
|
338
|
+
Object.keys(n).length > 0 && await ie(s.sender, n);
|
|
339
|
+
}, $ = (n) => {
|
|
340
|
+
if (!le(n) && !Se(n))
|
|
341
341
|
throw n;
|
|
342
342
|
return { isSuccessful: !1 };
|
|
343
|
-
},
|
|
344
|
-
class
|
|
343
|
+
}, Ze = ({ kind: n, readyState: e }) => n === "video" && e === "live";
|
|
344
|
+
class ln {
|
|
345
345
|
constructor(e, {
|
|
346
346
|
preferredMimeTypesVideoCodecs: t,
|
|
347
347
|
excludeMimeTypesVideoCodecs: s
|
|
348
348
|
} = {}) {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
349
|
+
u(this, "sipConnector");
|
|
350
|
+
u(this, "preferredMimeTypesVideoCodecs");
|
|
351
|
+
u(this, "excludeMimeTypesVideoCodecs");
|
|
352
|
+
u(this, "on");
|
|
353
|
+
u(this, "once");
|
|
354
|
+
u(this, "onceRace");
|
|
355
|
+
u(this, "wait");
|
|
356
|
+
u(this, "off");
|
|
357
|
+
u(this, "onSession");
|
|
358
|
+
u(this, "onceSession");
|
|
359
|
+
u(this, "onceRaceSession");
|
|
360
|
+
u(this, "waitSession");
|
|
361
|
+
u(this, "offSession");
|
|
362
|
+
u(this, "sendDTMF");
|
|
363
|
+
u(this, "hangUp");
|
|
364
|
+
u(this, "declineToIncomingCall");
|
|
365
|
+
u(this, "isConfigured");
|
|
366
|
+
u(this, "sendChannels");
|
|
367
|
+
u(this, "checkTelephony");
|
|
368
|
+
u(this, "waitChannels");
|
|
369
|
+
u(this, "ping");
|
|
370
|
+
u(this, "connectToServer", async (e) => {
|
|
353
371
|
const {
|
|
354
372
|
userAgent: t,
|
|
355
373
|
sipWebSocketServerURL: s,
|
|
356
|
-
sipServerUrl:
|
|
357
|
-
remoteAddress:
|
|
358
|
-
displayName:
|
|
359
|
-
name:
|
|
360
|
-
password:
|
|
374
|
+
sipServerUrl: o,
|
|
375
|
+
remoteAddress: r,
|
|
376
|
+
displayName: i,
|
|
377
|
+
name: c,
|
|
378
|
+
password: d,
|
|
361
379
|
isRegisteredUser: S,
|
|
362
380
|
isDisconnectOnFail: C
|
|
363
381
|
} = e;
|
|
364
382
|
return a("connectToServer", e), this.sipConnector.connect({
|
|
365
383
|
userAgent: t,
|
|
366
384
|
sipWebSocketServerURL: s,
|
|
367
|
-
sipServerUrl:
|
|
368
|
-
remoteAddress:
|
|
369
|
-
displayName:
|
|
370
|
-
password:
|
|
371
|
-
user:
|
|
385
|
+
sipServerUrl: o,
|
|
386
|
+
remoteAddress: r,
|
|
387
|
+
displayName: i,
|
|
388
|
+
password: d,
|
|
389
|
+
user: c,
|
|
372
390
|
register: S
|
|
373
|
-
}).then((
|
|
391
|
+
}).then((h) => (a("connectToServer then"), { ua: h, isSuccessful: !0 })).catch(async (h) => (a("connectToServer catch: error", h), C === !0 ? this.sipConnector.disconnect().then(() => $(h)).catch(() => $(h)) : $(h)));
|
|
374
392
|
});
|
|
375
|
-
|
|
393
|
+
u(this, "callToServer", async (e) => {
|
|
376
394
|
const {
|
|
377
395
|
conference: t,
|
|
378
396
|
mediaStream: s,
|
|
379
|
-
extraHeaders:
|
|
380
|
-
iceServers:
|
|
381
|
-
contentHint:
|
|
382
|
-
simulcastEncodings:
|
|
383
|
-
degradationPreference:
|
|
397
|
+
extraHeaders: o,
|
|
398
|
+
iceServers: r,
|
|
399
|
+
contentHint: i,
|
|
400
|
+
simulcastEncodings: c,
|
|
401
|
+
degradationPreference: d,
|
|
384
402
|
sendEncodings: S,
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
403
|
+
offerToReceiveAudio: C,
|
|
404
|
+
offerToReceiveVideo: h,
|
|
405
|
+
directionVideo: I,
|
|
406
|
+
directionAudio: F,
|
|
407
|
+
setRemoteStreams: f,
|
|
408
|
+
onBeforeProgressCall: p,
|
|
409
|
+
onSuccessProgressCall: m,
|
|
388
410
|
onEnterPurgatory: R,
|
|
389
|
-
onEnterConference:
|
|
390
|
-
onFailProgressCall:
|
|
391
|
-
onFinishProgressCall:
|
|
411
|
+
onEnterConference: y,
|
|
412
|
+
onFailProgressCall: T,
|
|
413
|
+
onFinishProgressCall: E,
|
|
392
414
|
onEndedCall: b
|
|
393
415
|
} = e, _ = this.resolveHandleReadyRemoteStreamsDebounced({
|
|
394
|
-
onReadyRemoteStreams:
|
|
395
|
-
}),
|
|
416
|
+
onReadyRemoteStreams: f
|
|
417
|
+
}), v = this.resolveHandleReadyRemoteStreams({
|
|
396
418
|
onReadyRemoteStreams: _
|
|
397
|
-
}),
|
|
419
|
+
}), O = P(
|
|
398
420
|
{
|
|
399
|
-
degradationPreference:
|
|
421
|
+
degradationPreference: d
|
|
400
422
|
},
|
|
401
423
|
{
|
|
402
424
|
preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
|
|
@@ -404,58 +426,66 @@ class cn {
|
|
|
404
426
|
}
|
|
405
427
|
);
|
|
406
428
|
a("callToServer", e);
|
|
407
|
-
const
|
|
429
|
+
const N = async () => (a("startCall"), this.sipConnector.call({
|
|
408
430
|
mediaStream: s,
|
|
409
|
-
extraHeaders:
|
|
410
|
-
iceServers:
|
|
411
|
-
contentHint:
|
|
412
|
-
|
|
431
|
+
extraHeaders: o,
|
|
432
|
+
iceServers: r,
|
|
433
|
+
contentHint: i,
|
|
434
|
+
offerToReceiveAudio: C,
|
|
435
|
+
offerToReceiveVideo: h,
|
|
436
|
+
directionVideo: I,
|
|
437
|
+
directionAudio: F,
|
|
438
|
+
sendEncodings: B({
|
|
413
439
|
mediaStream: s,
|
|
414
|
-
simulcastEncodings:
|
|
440
|
+
simulcastEncodings: c,
|
|
415
441
|
sendEncodings: S
|
|
416
442
|
}),
|
|
417
443
|
number: t,
|
|
418
|
-
onAddedTransceiver:
|
|
419
|
-
ontrack:
|
|
444
|
+
onAddedTransceiver: O,
|
|
445
|
+
ontrack: v
|
|
420
446
|
}));
|
|
421
|
-
let
|
|
422
|
-
const
|
|
423
|
-
a("enterRoom", { _room:
|
|
447
|
+
let M = !1, A;
|
|
448
|
+
const w = (a("subscribeEnterConference: onEnterConference", y), R ?? y ? this.sipConnector.onSession("enterRoom", ({ room: l }) => {
|
|
449
|
+
a("enterRoom", { _room: l, isSuccessProgressCall: M }), A = l, D(A) ? R && R() : y && y({ isSuccessProgressCall: M });
|
|
424
450
|
}) : () => {
|
|
425
|
-
}),
|
|
426
|
-
|
|
427
|
-
}),
|
|
428
|
-
throw a("onFail"),
|
|
429
|
-
},
|
|
430
|
-
a("onFinish"),
|
|
451
|
+
}), k = (l) => (a("onSuccess"), M = !0, _(), m && m({ isPurgatory: D(A) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
|
|
452
|
+
w(), b && b();
|
|
453
|
+
}), l), U = (l) => {
|
|
454
|
+
throw a("onFail"), T && T(), w(), l;
|
|
455
|
+
}, V = () => {
|
|
456
|
+
a("onFinish"), E && E();
|
|
431
457
|
};
|
|
432
|
-
return a("onBeforeProgressCall"),
|
|
458
|
+
return a("onBeforeProgressCall"), p && p(t), N().then(k).catch((l) => U(l)).finally(V);
|
|
433
459
|
});
|
|
434
|
-
|
|
435
|
-
|
|
460
|
+
u(this, "disconnectFromServer", async () => this.sipConnector.disconnect().then(() => (a("disconnectFromServer: then"), { isSuccessful: !0 })).catch((e) => (a("disconnectFromServer: catch", e), { isSuccessful: !1 })));
|
|
461
|
+
u(this, "answerIncomingCall", async (e) => {
|
|
436
462
|
const {
|
|
437
463
|
mediaStream: t,
|
|
438
464
|
extraHeaders: s,
|
|
439
|
-
iceServers:
|
|
440
|
-
contentHint:
|
|
441
|
-
simulcastEncodings:
|
|
442
|
-
degradationPreference:
|
|
443
|
-
sendEncodings:
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
465
|
+
iceServers: o,
|
|
466
|
+
contentHint: r,
|
|
467
|
+
simulcastEncodings: i,
|
|
468
|
+
degradationPreference: c,
|
|
469
|
+
sendEncodings: d,
|
|
470
|
+
offerToReceiveAudio: S,
|
|
471
|
+
offerToReceiveVideo: C,
|
|
472
|
+
directionVideo: h,
|
|
473
|
+
directionAudio: I,
|
|
474
|
+
setRemoteStreams: F,
|
|
475
|
+
onBeforeProgressCall: f,
|
|
476
|
+
onSuccessProgressCall: p,
|
|
477
|
+
onEnterPurgatory: m,
|
|
448
478
|
onEnterConference: R,
|
|
449
|
-
onFailProgressCall:
|
|
450
|
-
onFinishProgressCall:
|
|
451
|
-
onEndedCall:
|
|
479
|
+
onFailProgressCall: y,
|
|
480
|
+
onFinishProgressCall: T,
|
|
481
|
+
onEndedCall: E
|
|
452
482
|
} = e, b = this.resolveHandleReadyRemoteStreamsDebounced({
|
|
453
|
-
onReadyRemoteStreams:
|
|
483
|
+
onReadyRemoteStreams: F
|
|
454
484
|
}), _ = this.resolveHandleReadyRemoteStreams({
|
|
455
485
|
onReadyRemoteStreams: b
|
|
456
|
-
}),
|
|
486
|
+
}), v = P(
|
|
457
487
|
{
|
|
458
|
-
degradationPreference:
|
|
488
|
+
degradationPreference: c
|
|
459
489
|
},
|
|
460
490
|
{
|
|
461
491
|
preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
|
|
@@ -463,88 +493,92 @@ class cn {
|
|
|
463
493
|
}
|
|
464
494
|
);
|
|
465
495
|
a("answerIncomingCall", e);
|
|
466
|
-
const
|
|
496
|
+
const O = async () => this.sipConnector.answerToIncomingCall({
|
|
467
497
|
mediaStream: t,
|
|
468
498
|
extraHeaders: s,
|
|
469
|
-
iceServers:
|
|
470
|
-
contentHint:
|
|
471
|
-
|
|
499
|
+
iceServers: o,
|
|
500
|
+
contentHint: r,
|
|
501
|
+
offerToReceiveAudio: S,
|
|
502
|
+
offerToReceiveVideo: C,
|
|
503
|
+
directionVideo: h,
|
|
504
|
+
directionAudio: I,
|
|
505
|
+
sendEncodings: B({
|
|
472
506
|
mediaStream: t,
|
|
473
|
-
simulcastEncodings:
|
|
474
|
-
sendEncodings:
|
|
507
|
+
simulcastEncodings: i,
|
|
508
|
+
sendEncodings: d
|
|
475
509
|
}),
|
|
476
|
-
onAddedTransceiver:
|
|
510
|
+
onAddedTransceiver: v,
|
|
477
511
|
ontrack: _
|
|
478
|
-
}),
|
|
479
|
-
const { remoteCallerData:
|
|
480
|
-
return
|
|
512
|
+
}), N = () => {
|
|
513
|
+
const { remoteCallerData: l } = this.sipConnector;
|
|
514
|
+
return l.incomingNumber;
|
|
481
515
|
};
|
|
482
|
-
let
|
|
483
|
-
const
|
|
484
|
-
a("enterRoom", { _room:
|
|
516
|
+
let M = !1, A;
|
|
517
|
+
const w = (a("subscribeEnterConference: onEnterConference", R), m ?? R ? this.sipConnector.onSession("enterRoom", (l) => {
|
|
518
|
+
a("enterRoom", { _room: l, isSuccessProgressCall: M }), A = l, D(A) ? m && m() : R && R({ isSuccessProgressCall: M });
|
|
485
519
|
}) : () => {
|
|
486
|
-
}),
|
|
487
|
-
|
|
488
|
-
}),
|
|
489
|
-
throw a("onFail"),
|
|
490
|
-
},
|
|
491
|
-
a("onFinish"),
|
|
520
|
+
}), k = (l) => (a("onSuccess"), M = !0, b(), p && p({ isPurgatory: D(A) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
|
|
521
|
+
w(), E && E();
|
|
522
|
+
}), l), U = (l) => {
|
|
523
|
+
throw a("onFail"), y && y(), w(), l;
|
|
524
|
+
}, V = () => {
|
|
525
|
+
a("onFinish"), T && T();
|
|
492
526
|
};
|
|
493
|
-
if (a("onBeforeProgressCall"),
|
|
494
|
-
const
|
|
495
|
-
|
|
527
|
+
if (a("onBeforeProgressCall"), f) {
|
|
528
|
+
const l = N();
|
|
529
|
+
f(l);
|
|
496
530
|
}
|
|
497
|
-
return
|
|
531
|
+
return O().then(k).catch((l) => U(l)).finally(V);
|
|
498
532
|
});
|
|
499
|
-
|
|
533
|
+
u(this, "updatePresentation", async ({
|
|
500
534
|
mediaStream: e,
|
|
501
535
|
isP2P: t,
|
|
502
536
|
maxBitrate: s,
|
|
503
|
-
contentHint:
|
|
504
|
-
simulcastEncodings:
|
|
505
|
-
degradationPreference:
|
|
506
|
-
sendEncodings:
|
|
507
|
-
preferredMimeTypesVideoCodecs:
|
|
537
|
+
contentHint: o,
|
|
538
|
+
simulcastEncodings: r,
|
|
539
|
+
degradationPreference: i,
|
|
540
|
+
sendEncodings: c,
|
|
541
|
+
preferredMimeTypesVideoCodecs: d,
|
|
508
542
|
excludeMimeTypesVideoCodecs: S
|
|
509
543
|
}) => {
|
|
510
|
-
const C =
|
|
544
|
+
const C = P(
|
|
511
545
|
{
|
|
512
|
-
degradationPreference:
|
|
546
|
+
degradationPreference: i
|
|
513
547
|
},
|
|
514
548
|
{
|
|
515
|
-
preferredMimeTypesVideoCodecs:
|
|
549
|
+
preferredMimeTypesVideoCodecs: d,
|
|
516
550
|
excludeMimeTypesVideoCodecs: S
|
|
517
551
|
}
|
|
518
552
|
);
|
|
519
553
|
return a("updatePresentation"), this.sipConnector.updatePresentation(e, {
|
|
520
554
|
isP2P: t,
|
|
521
555
|
maxBitrate: s,
|
|
522
|
-
contentHint:
|
|
523
|
-
sendEncodings:
|
|
556
|
+
contentHint: o,
|
|
557
|
+
sendEncodings: B({
|
|
524
558
|
mediaStream: e,
|
|
525
|
-
simulcastEncodings:
|
|
526
|
-
sendEncodings:
|
|
559
|
+
simulcastEncodings: r,
|
|
560
|
+
sendEncodings: c
|
|
527
561
|
}),
|
|
528
562
|
onAddedTransceiver: C
|
|
529
563
|
});
|
|
530
564
|
});
|
|
531
|
-
|
|
565
|
+
u(this, "startPresentation", async ({
|
|
532
566
|
mediaStream: e,
|
|
533
567
|
isP2P: t,
|
|
534
568
|
maxBitrate: s,
|
|
535
|
-
contentHint:
|
|
536
|
-
simulcastEncodings:
|
|
537
|
-
degradationPreference:
|
|
538
|
-
sendEncodings:
|
|
539
|
-
preferredMimeTypesVideoCodecs:
|
|
569
|
+
contentHint: o,
|
|
570
|
+
simulcastEncodings: r,
|
|
571
|
+
degradationPreference: i,
|
|
572
|
+
sendEncodings: c,
|
|
573
|
+
preferredMimeTypesVideoCodecs: d,
|
|
540
574
|
excludeMimeTypesVideoCodecs: S
|
|
541
575
|
}, C) => {
|
|
542
|
-
const
|
|
576
|
+
const h = P(
|
|
543
577
|
{
|
|
544
|
-
degradationPreference:
|
|
578
|
+
degradationPreference: i
|
|
545
579
|
},
|
|
546
580
|
{
|
|
547
|
-
preferredMimeTypesVideoCodecs:
|
|
581
|
+
preferredMimeTypesVideoCodecs: d,
|
|
548
582
|
excludeMimeTypesVideoCodecs: S
|
|
549
583
|
}
|
|
550
584
|
);
|
|
@@ -553,53 +587,53 @@ class cn {
|
|
|
553
587
|
{
|
|
554
588
|
isP2P: t,
|
|
555
589
|
maxBitrate: s,
|
|
556
|
-
contentHint:
|
|
557
|
-
sendEncodings:
|
|
590
|
+
contentHint: o,
|
|
591
|
+
sendEncodings: B({
|
|
558
592
|
mediaStream: e,
|
|
559
|
-
simulcastEncodings:
|
|
560
|
-
sendEncodings:
|
|
593
|
+
simulcastEncodings: r,
|
|
594
|
+
sendEncodings: c
|
|
561
595
|
}),
|
|
562
|
-
onAddedTransceiver:
|
|
596
|
+
onAddedTransceiver: h
|
|
563
597
|
},
|
|
564
598
|
C
|
|
565
599
|
);
|
|
566
600
|
});
|
|
567
|
-
|
|
601
|
+
u(this, "stopShareSipConnector", async ({ isP2P: e = !1 } = {}) => (a("stopShareSipConnector"), this.sipConnector.stopPresentation({
|
|
568
602
|
isP2P: e
|
|
569
603
|
}).catch((t) => {
|
|
570
604
|
a(t);
|
|
571
605
|
})));
|
|
572
|
-
|
|
606
|
+
u(this, "sendRefusalToTurnOnMic", async () => {
|
|
573
607
|
if (this.sipConnector.isCallActive)
|
|
574
608
|
return a("sendRefusalToTurnOnMic"), this.sipConnector.sendRefusalToTurnOnMic().catch((e) => {
|
|
575
609
|
a("sendRefusalToTurnOnMic: error", e);
|
|
576
610
|
});
|
|
577
611
|
});
|
|
578
|
-
|
|
612
|
+
u(this, "sendRefusalToTurnOnCam", async () => {
|
|
579
613
|
if (this.sipConnector.isCallActive)
|
|
580
614
|
return a("sendRefusalToTurnOnCam"), this.sipConnector.sendRefusalToTurnOnCam().catch((e) => {
|
|
581
615
|
a("sendRefusalToTurnOnCam: error", e);
|
|
582
616
|
});
|
|
583
617
|
});
|
|
584
|
-
|
|
618
|
+
u(this, "sendMediaState", async ({
|
|
585
619
|
isEnabledCam: e,
|
|
586
620
|
isEnabledMic: t
|
|
587
621
|
}) => {
|
|
588
622
|
if (this.sipConnector.isCallActive)
|
|
589
623
|
return a("sendMediaState"), this.sipConnector.sendMediaState({ cam: e, mic: t });
|
|
590
624
|
});
|
|
591
|
-
|
|
625
|
+
u(this, "replaceMediaStream", async (e, {
|
|
592
626
|
deleteExisting: t,
|
|
593
627
|
addMissing: s,
|
|
594
|
-
forceRenegotiation:
|
|
595
|
-
contentHint:
|
|
596
|
-
simulcastEncodings:
|
|
597
|
-
degradationPreference:
|
|
598
|
-
sendEncodings:
|
|
628
|
+
forceRenegotiation: o,
|
|
629
|
+
contentHint: r,
|
|
630
|
+
simulcastEncodings: i,
|
|
631
|
+
degradationPreference: c,
|
|
632
|
+
sendEncodings: d
|
|
599
633
|
} = {}) => {
|
|
600
|
-
const S =
|
|
634
|
+
const S = P(
|
|
601
635
|
{
|
|
602
|
-
degradationPreference:
|
|
636
|
+
degradationPreference: c
|
|
603
637
|
},
|
|
604
638
|
{
|
|
605
639
|
preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
|
|
@@ -609,56 +643,59 @@ class cn {
|
|
|
609
643
|
return a("replaceMediaStream"), this.sipConnector.replaceMediaStream(e, {
|
|
610
644
|
deleteExisting: t,
|
|
611
645
|
addMissing: s,
|
|
612
|
-
forceRenegotiation:
|
|
613
|
-
contentHint:
|
|
614
|
-
sendEncodings:
|
|
646
|
+
forceRenegotiation: o,
|
|
647
|
+
contentHint: r,
|
|
648
|
+
sendEncodings: B({
|
|
615
649
|
mediaStream: e,
|
|
616
|
-
simulcastEncodings:
|
|
617
|
-
sendEncodings:
|
|
650
|
+
simulcastEncodings: i,
|
|
651
|
+
sendEncodings: d
|
|
618
652
|
}),
|
|
619
653
|
onAddedTransceiver: S
|
|
620
654
|
});
|
|
621
655
|
});
|
|
622
|
-
|
|
656
|
+
u(this, "askPermissionToEnableCam", async () => {
|
|
623
657
|
if (this.sipConnector.isCallActive)
|
|
624
658
|
return a("askPermissionToEnableCam"), this.sipConnector.askPermissionToEnableCam();
|
|
625
659
|
});
|
|
626
|
-
|
|
660
|
+
u(this, "resolveHandleReadyRemoteStreamsDebounced", ({
|
|
627
661
|
onReadyRemoteStreams: e
|
|
628
|
-
}) =>
|
|
662
|
+
}) => he(() => {
|
|
629
663
|
const t = this.sipConnector.getRemoteStreams();
|
|
630
664
|
a("remoteStreams", t), t && e(t);
|
|
631
665
|
}, 200));
|
|
632
|
-
|
|
666
|
+
u(this, "resolveHandleReadyRemoteStreams", ({
|
|
633
667
|
onReadyRemoteStreams: e
|
|
634
668
|
}) => ({ track: t }) => {
|
|
635
|
-
|
|
669
|
+
Ze(t) && e();
|
|
636
670
|
});
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
this.sipConnector = e, this.
|
|
671
|
+
u(this, "getRemoteStreams", () => (a("getRemoteStreams"), this.sipConnector.getRemoteStreams()));
|
|
672
|
+
u(this, "onUseLicense", (e) => (a("onUseLicense"), this.sipConnector.onSession("useLicense", e)));
|
|
673
|
+
u(this, "onMustStopPresentation", (e) => (a("onMustStopPresentation"), this.sipConnector.onSession("mustStopPresentation", e)));
|
|
674
|
+
u(this, "onMoveToSpectators", (e) => (a("onMoveToSpectators"), this.sipConnector.onSession(ce, e)));
|
|
675
|
+
u(this, "onMoveToParticipants", (e) => (a("onMoveToParticipants"), this.sipConnector.onSession(ae, e)));
|
|
676
|
+
this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.sipConnector = e, this.on = this.sipConnector.on.bind(e), this.once = this.sipConnector.once.bind(e), this.onceRace = this.sipConnector.onceRace.bind(e), this.wait = this.sipConnector.wait.bind(e), this.off = this.sipConnector.off.bind(e), this.onSession = this.sipConnector.onSession.bind(e), this.onceSession = this.sipConnector.onceSession.bind(e), this.onceRaceSession = this.sipConnector.onceRaceSession.bind(e), this.waitSession = this.sipConnector.waitSession.bind(e), this.offSession = this.sipConnector.offSession.bind(e), this.sendDTMF = this.sipConnector.sendDTMF.bind(e), this.hangUp = this.sipConnector.hangUp.bind(e), this.declineToIncomingCall = this.sipConnector.declineToIncomingCall.bind(e), this.isConfigured = this.sipConnector.isConfigured.bind(e), this.sendChannels = this.sipConnector.sendChannels.bind(e), this.checkTelephony = this.sipConnector.checkTelephony.bind(e), this.waitChannels = this.sipConnector.waitChannels.bind(e), this.ping = this.sipConnector.ping.bind(e);
|
|
677
|
+
}
|
|
678
|
+
get isRegistered() {
|
|
679
|
+
return this.sipConnector.isRegistered;
|
|
643
680
|
}
|
|
644
681
|
}
|
|
645
682
|
export {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
683
|
+
L as EEventsMainCAM,
|
|
684
|
+
Cn as EEventsMic,
|
|
685
|
+
fn as EEventsSyncMediaState,
|
|
686
|
+
mn as EMimeTypesVideoCodecs,
|
|
687
|
+
Rn as EUseLicense,
|
|
688
|
+
ln as SipConnectorFacade,
|
|
689
|
+
gn as causes,
|
|
690
|
+
pn as constants,
|
|
691
|
+
An as debug,
|
|
692
|
+
tn as default,
|
|
693
|
+
yn as disableDebug,
|
|
694
|
+
Tn as enableDebug,
|
|
695
|
+
En as eventNames,
|
|
696
|
+
De as getCodecFromSender,
|
|
697
|
+
bn as hasCanceledCallError,
|
|
698
|
+
dn as resolveVideoSendingBalancer,
|
|
699
|
+
ie as setParametersToSender,
|
|
700
|
+
un as tools
|
|
664
701
|
};
|