sip-connector 11.1.0 → 11.2.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-zEWljwQJ.js → SipConnector-BqK7EICM.js} +223 -217
- package/dist/SipConnector-_gw-GKlW.cjs +1 -0
- package/dist/SipConnector.d.ts +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +1 -1
- package/dist/eventNames.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +161 -160
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/resolveOnMoveToParticipants.d.ts +3 -0
- package/package.json +5 -5
- package/dist/SipConnector-5B3QzrjB.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { l as a, B as X, N as G, E as
|
|
2
|
-
import {
|
|
3
|
-
import { debounce as
|
|
4
|
-
import { isCanceledError as
|
|
5
|
-
import { hasCanceledError as
|
|
6
|
-
import { sequentPromises as
|
|
7
|
-
import { createStackPromises as
|
|
8
|
-
import { default as
|
|
9
|
-
const
|
|
10
|
-
const n =
|
|
1
|
+
import { l as a, B as X, N as G, P as Z, a as ee, E as I, s as ne, S as on } from "./SipConnector-BqK7EICM.js";
|
|
2
|
+
import { i as Cn, j as En, k as Rn, c as Tn, b as hn, d as Mn, f as yn, e as _n, h as bn, g as On } from "./SipConnector-BqK7EICM.js";
|
|
3
|
+
import { debounce as te } from "ts-debounce";
|
|
4
|
+
import { isCanceledError as se } from "@krivega/cancelable-promise";
|
|
5
|
+
import { hasCanceledError as re } from "repeated-calls";
|
|
6
|
+
import { sequentPromises as oe } from "sequent-promises";
|
|
7
|
+
import { createStackPromises as ae } from "stack-promises";
|
|
8
|
+
import { default as vn } from "debug";
|
|
9
|
+
const ce = (e) => e.getVideoTracks()[0], ie = 1e6, C = (e) => e * ie, H = C(0.06), ue = C(4), le = (e) => e <= 64 ? H : e <= 128 ? C(0.12) : e <= 256 ? C(0.25) : e <= 384 ? C(0.32) : e <= 426 ? C(0.38) : e <= 640 ? C(0.5) : e <= 848 ? C(0.7) : e <= 1280 ? C(1) : e <= 1920 ? C(2) : ue, W = (e, t) => e !== void 0 && t !== void 0 && e.toLowerCase().includes(t.toLowerCase()), Se = "av1", de = (e) => W(e, Se), me = 0.6, j = (e, t) => de(t) ? e * me : e, fe = (e) => j(H, e), K = (e, t) => {
|
|
10
|
+
const n = le(e);
|
|
11
11
|
return j(n, t);
|
|
12
|
-
},
|
|
12
|
+
}, ge = 1, Y = ({
|
|
13
13
|
videoTrack: e,
|
|
14
14
|
targetSize: t,
|
|
15
15
|
codec: n
|
|
16
16
|
}) => {
|
|
17
|
-
const s = e.getSettings(), r = s.width, o = s.height, c = r / t.width, i = o / t.height, u = Math.max(c, i,
|
|
17
|
+
const s = e.getSettings(), r = s.width, o = s.height, c = r / t.width, i = o / t.height, u = Math.max(c, i, ge), S = K(t.width, n);
|
|
18
18
|
return { scaleResolutionDownBy: u, maxBitrate: S };
|
|
19
19
|
}, N = ({
|
|
20
20
|
mediaStream: e,
|
|
@@ -22,7 +22,7 @@ const oe = (e) => e.getVideoTracks()[0], ae = 1e6, C = (e) => e * ae, H = C(0.06
|
|
|
22
22
|
sendEncodings: n
|
|
23
23
|
}) => {
|
|
24
24
|
if (t && t.length > 0) {
|
|
25
|
-
const s = n ?? [], r =
|
|
25
|
+
const s = n ?? [], r = ce(e);
|
|
26
26
|
return t.forEach((o, c) => {
|
|
27
27
|
const i = s[c] ?? {}, { maxBitrate: u, scaleResolutionDownBy: S } = Y({
|
|
28
28
|
videoTrack: r,
|
|
@@ -35,15 +35,15 @@ const oe = (e) => e.getVideoTracks()[0], ae = 1e6, C = (e) => e * ae, H = C(0.06
|
|
|
35
35
|
}), s;
|
|
36
36
|
}
|
|
37
37
|
return n;
|
|
38
|
-
},
|
|
39
|
-
|
|
38
|
+
}, z = "purgatory", A = (e) => e === z, k = (e) => () => (a("getRemoteStreams"), e.getRemoteStreams()), Ce = ({ kind: e, readyState: t }) => e === "video" && t === "live", Q = (e) => ({ track: t }) => {
|
|
39
|
+
Ce(t) && e();
|
|
40
40
|
}, U = ({
|
|
41
41
|
getRemoteStreams: e,
|
|
42
42
|
setRemoteStreams: t
|
|
43
|
-
}) =>
|
|
43
|
+
}) => te(() => {
|
|
44
44
|
const n = e();
|
|
45
45
|
a("remoteStreams", n), n && t(n);
|
|
46
|
-
}, 200),
|
|
46
|
+
}, 200), Ee = (e) => async (n) => {
|
|
47
47
|
const {
|
|
48
48
|
mediaStream: s,
|
|
49
49
|
extraHeaders: r,
|
|
@@ -55,16 +55,16 @@ const oe = (e) => e.getVideoTracks()[0], ae = 1e6, C = (e) => e * ae, H = C(0.06
|
|
|
55
55
|
onBeforeProgressCall: g,
|
|
56
56
|
onSuccessProgressCall: f,
|
|
57
57
|
onEnterPurgatory: d,
|
|
58
|
-
onEnterConference:
|
|
58
|
+
onEnterConference: E,
|
|
59
59
|
onFailProgressCall: m,
|
|
60
|
-
onFinishProgressCall:
|
|
61
|
-
onEndedCall:
|
|
62
|
-
} = n,
|
|
60
|
+
onFinishProgressCall: R,
|
|
61
|
+
onEndedCall: T
|
|
62
|
+
} = n, y = U({
|
|
63
63
|
setRemoteStreams: S,
|
|
64
64
|
getRemoteStreams: k(e)
|
|
65
|
-
}),
|
|
65
|
+
}), b = Q(y);
|
|
66
66
|
a("answerIncomingCall", n);
|
|
67
|
-
const
|
|
67
|
+
const O = async () => e.answerToIncomingCall({
|
|
68
68
|
mediaStream: s,
|
|
69
69
|
extraHeaders: r,
|
|
70
70
|
iceServers: o,
|
|
@@ -74,28 +74,28 @@ const oe = (e) => e.getVideoTracks()[0], ae = 1e6, C = (e) => e * ae, H = C(0.06
|
|
|
74
74
|
simulcastEncodings: i,
|
|
75
75
|
sendEncodings: u
|
|
76
76
|
}),
|
|
77
|
-
ontrack:
|
|
78
|
-
}),
|
|
77
|
+
ontrack: b
|
|
78
|
+
}), p = () => {
|
|
79
79
|
const { remoteCallerData: l } = e;
|
|
80
80
|
return l.incomingNumber;
|
|
81
81
|
};
|
|
82
|
-
let
|
|
83
|
-
const
|
|
84
|
-
a("enterRoom", { _room: l, isSuccessProgressCall:
|
|
82
|
+
let h = !1, M;
|
|
83
|
+
const _ = (a("subscribeEnterConference: onEnterConference", E), d ?? E ? e.onSession("enterRoom", (l) => {
|
|
84
|
+
a("enterRoom", { _room: l, isSuccessProgressCall: h }), M = l, A(M) ? d && d() : E && E({ isSuccessProgressCall: h });
|
|
85
85
|
}) : () => {
|
|
86
|
-
}), v = (l) => (a("onSuccess"),
|
|
87
|
-
|
|
88
|
-
}), l),
|
|
89
|
-
throw a("onFail"), m && m(),
|
|
90
|
-
},
|
|
91
|
-
a("onFinish"),
|
|
86
|
+
}), v = (l) => (a("onSuccess"), h = !0, y(), f && f({ isPurgatory: A(M) }), e.onceRaceSession(["ended", "failed"], () => {
|
|
87
|
+
_(), T && T();
|
|
88
|
+
}), l), B = (l) => {
|
|
89
|
+
throw a("onFail"), m && m(), _(), l;
|
|
90
|
+
}, w = () => {
|
|
91
|
+
a("onFinish"), R && R();
|
|
92
92
|
};
|
|
93
93
|
if (a("onBeforeProgressCall"), g) {
|
|
94
|
-
const l =
|
|
94
|
+
const l = p();
|
|
95
95
|
g(l);
|
|
96
96
|
}
|
|
97
|
-
return
|
|
98
|
-
},
|
|
97
|
+
return O().then(v).catch((l) => B(l)).finally(w);
|
|
98
|
+
}, Re = (e) => async (n) => {
|
|
99
99
|
const {
|
|
100
100
|
conference: s,
|
|
101
101
|
mediaStream: r,
|
|
@@ -107,17 +107,17 @@ const oe = (e) => e.getVideoTracks()[0], ae = 1e6, C = (e) => e * ae, H = C(0.06
|
|
|
107
107
|
setRemoteStreams: g,
|
|
108
108
|
onBeforeProgressCall: f,
|
|
109
109
|
onSuccessProgressCall: d,
|
|
110
|
-
onEnterPurgatory:
|
|
110
|
+
onEnterPurgatory: E,
|
|
111
111
|
onEnterConference: m,
|
|
112
|
-
onFailProgressCall:
|
|
113
|
-
onFinishProgressCall:
|
|
114
|
-
onEndedCall:
|
|
115
|
-
} = n,
|
|
112
|
+
onFailProgressCall: R,
|
|
113
|
+
onFinishProgressCall: T,
|
|
114
|
+
onEndedCall: y
|
|
115
|
+
} = n, b = U({
|
|
116
116
|
setRemoteStreams: g,
|
|
117
117
|
getRemoteStreams: k(e)
|
|
118
|
-
}),
|
|
118
|
+
}), O = Q(b);
|
|
119
119
|
a("callToServer", n);
|
|
120
|
-
const
|
|
120
|
+
const p = async () => (a("startCall"), e.call({
|
|
121
121
|
mediaStream: r,
|
|
122
122
|
extraHeaders: o,
|
|
123
123
|
iceServers: c,
|
|
@@ -128,25 +128,25 @@ const oe = (e) => e.getVideoTracks()[0], ae = 1e6, C = (e) => e * ae, H = C(0.06
|
|
|
128
128
|
sendEncodings: S
|
|
129
129
|
}),
|
|
130
130
|
number: s,
|
|
131
|
-
ontrack:
|
|
131
|
+
ontrack: O
|
|
132
132
|
}));
|
|
133
|
-
let
|
|
134
|
-
const
|
|
135
|
-
a("enterRoom", { _room: l, isSuccessProgressCall:
|
|
133
|
+
let h = !1, M;
|
|
134
|
+
const _ = (a("subscribeEnterConference: onEnterConference", m), E ?? m ? e.onSession("enterRoom", ({ room: l }) => {
|
|
135
|
+
a("enterRoom", { _room: l, isSuccessProgressCall: h }), M = l, A(M) ? E && E() : m && m({ isSuccessProgressCall: h });
|
|
136
136
|
}) : () => {
|
|
137
|
-
}), v = (l) => (a("onSuccess"),
|
|
138
|
-
|
|
139
|
-
}), l),
|
|
140
|
-
throw a("onFail"),
|
|
141
|
-
},
|
|
142
|
-
a("onFinish"),
|
|
137
|
+
}), v = (l) => (a("onSuccess"), h = !0, b(), d && d({ isPurgatory: A(M) }), e.onceRaceSession(["ended", "failed"], () => {
|
|
138
|
+
_(), y && y();
|
|
139
|
+
}), l), B = (l) => {
|
|
140
|
+
throw a("onFail"), R && R(), _(), l;
|
|
141
|
+
}, w = () => {
|
|
142
|
+
a("onFinish"), T && T();
|
|
143
143
|
};
|
|
144
|
-
return a("onBeforeProgressCall"), f && f(s),
|
|
145
|
-
},
|
|
146
|
-
if (!
|
|
144
|
+
return a("onBeforeProgressCall"), f && f(s), p().then(v).catch((l) => B(l)).finally(w);
|
|
145
|
+
}, D = (e) => {
|
|
146
|
+
if (!se(e) && !re(e))
|
|
147
147
|
throw e;
|
|
148
148
|
return { isSuccessful: !1 };
|
|
149
|
-
},
|
|
149
|
+
}, Te = (e) => async (n) => {
|
|
150
150
|
const {
|
|
151
151
|
userAgent: s,
|
|
152
152
|
sipWebSocketServerURL: r,
|
|
@@ -167,14 +167,14 @@ const oe = (e) => e.getVideoTracks()[0], ae = 1e6, C = (e) => e * ae, H = C(0.06
|
|
|
167
167
|
password: S,
|
|
168
168
|
user: u,
|
|
169
169
|
register: g
|
|
170
|
-
}).then((d) => (a("connectToServer then"), { ua: d, isSuccessful: !0 })).catch(async (d) => (a("connectToServer catch: error", d), f === !0 ? e.disconnect().then(() =>
|
|
171
|
-
},
|
|
170
|
+
}).then((d) => (a("connectToServer then"), { ua: d, isSuccessful: !0 })).catch(async (d) => (a("connectToServer catch: error", d), f === !0 ? e.disconnect().then(() => D(d)).catch(() => D(d)) : D(d)));
|
|
171
|
+
}, he = (e) => async () => (a("disconnectFromServer"), e.disconnect().then(() => (a("disconnectFromServer: then"), { isSuccessful: !0 })).catch((t) => (a("disconnectFromServer: catch", t), { isSuccessful: !1 }))), L = (e) => {
|
|
172
172
|
const { url: t, cause: n } = e;
|
|
173
173
|
let s = t;
|
|
174
174
|
return (n === X || n === G) && (s = `${e.message.to.uri.user}@${e.message.to.uri.host}`), s;
|
|
175
175
|
};
|
|
176
|
-
var
|
|
177
|
-
const
|
|
176
|
+
var q = /* @__PURE__ */ ((e) => (e.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", e.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", e.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", e.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", e.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", e.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", e))(q || {});
|
|
177
|
+
const Me = (e = new Error()) => {
|
|
178
178
|
var r;
|
|
179
179
|
const { cause: t, socket: n } = e;
|
|
180
180
|
let s = "CONNECT_SERVER_FAILED";
|
|
@@ -203,16 +203,16 @@ const he = (e = new Error()) => {
|
|
|
203
203
|
a("failed to stringify message", n);
|
|
204
204
|
}
|
|
205
205
|
return t;
|
|
206
|
-
},
|
|
206
|
+
}, _e = (e = new Error()) => {
|
|
207
207
|
const { code: t, cause: n, message: s } = e, r = L(e), o = { code: "", cause: "", message: "" };
|
|
208
208
|
return typeof s == "object" && s !== null ? o.message = ye(s) : s && (o.message = String(s)), r && (o.link = r), t && (o.code = t), n && (o.cause = n), o;
|
|
209
|
-
},
|
|
209
|
+
}, be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
210
210
|
__proto__: null,
|
|
211
|
-
EErrorTypes:
|
|
211
|
+
EErrorTypes: q,
|
|
212
212
|
getLinkError: L,
|
|
213
|
-
getTypeFromError:
|
|
214
|
-
getValuesFromError:
|
|
215
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
213
|
+
getTypeFromError: Me,
|
|
214
|
+
getValuesFromError: _e
|
|
215
|
+
}, Symbol.toStringTag, { value: "Module" })), Oe = ({
|
|
216
216
|
sessionId: e,
|
|
217
217
|
remoteAddress: t,
|
|
218
218
|
isMutedAudio: n,
|
|
@@ -222,43 +222,43 @@ const he = (e = new Error()) => {
|
|
|
222
222
|
}) => {
|
|
223
223
|
const c = [], i = n ? "0" : "1", u = s ? "0" : "1";
|
|
224
224
|
return c.push(`X-Vinteo-Mic-State: ${i}`, `X-Vinteo-MainCam-State: ${u}`), r || c.push("X-Vinteo-Purgatory-Call: yes"), e && c.push(`X-Vinteo-Session: ${e}`), o && c.push("X-Vinteo-Presentation-Call: yes"), t && c.push(`X-Vinteo-Remote: ${t}`), c;
|
|
225
|
-
},
|
|
225
|
+
}, pe = "[@*!|]", ve = "_", Ae = (e) => {
|
|
226
226
|
let t = e;
|
|
227
|
-
return t = t.replaceAll(new RegExp(
|
|
228
|
-
},
|
|
227
|
+
return t = t.replaceAll(new RegExp(pe, "g"), ve), t;
|
|
228
|
+
}, Ne = ({
|
|
229
229
|
appName: e,
|
|
230
230
|
appVersion: t,
|
|
231
231
|
browserName: n,
|
|
232
232
|
browserVersion: s
|
|
233
233
|
}) => {
|
|
234
|
-
const o = `${
|
|
234
|
+
const o = `${Ae(e)} ${t}`;
|
|
235
235
|
return `ChromeNew - ${n ? `${n} ${s}, ${o}` : o}`;
|
|
236
|
-
},
|
|
236
|
+
}, Pe = ({
|
|
237
237
|
isUnifiedSdpSemantic: e,
|
|
238
238
|
appVersion: t,
|
|
239
239
|
browserName: n,
|
|
240
240
|
browserVersion: s,
|
|
241
241
|
appName: r
|
|
242
|
-
}) => e ?
|
|
242
|
+
}) => e ? Ne({ appVersion: t, browserName: n, browserVersion: s, appName: r }) : "Chrome", Be = (e) => async () => {
|
|
243
243
|
if (e.isCallActive)
|
|
244
244
|
return a("askPermissionToEnableCam"), e.askPermissionToEnableCam();
|
|
245
|
-
},
|
|
245
|
+
}, we = (e) => (n) => (a("onMustStopPresentation"), e.onSession("mustStopPresentation", n)), Ie = (e) => (n) => (a("onMoveToSpectators"), e.onSession(Z, n)), De = (e) => (n) => (a("onMoveToParticipants"), e.onSession(ee, n)), Fe = (e) => (n) => (a("onUseLicense"), e.onSession("useLicense", n)), ke = (e) => async ({
|
|
246
246
|
isEnabledCam: n,
|
|
247
247
|
isEnabledMic: s
|
|
248
248
|
}) => {
|
|
249
249
|
if (e.isCallActive)
|
|
250
250
|
return a("sendMediaState"), e.sendMediaState({ cam: n, mic: s });
|
|
251
|
-
},
|
|
251
|
+
}, Ue = (e) => async () => {
|
|
252
252
|
if (e.isCallActive)
|
|
253
253
|
return a("sendRefusalToTurnOnCam"), e.sendRefusalToTurnOnCam().catch((n) => {
|
|
254
254
|
a("sendRefusalToTurnOnCam: error", n);
|
|
255
255
|
});
|
|
256
|
-
},
|
|
256
|
+
}, Le = (e) => async () => {
|
|
257
257
|
if (e.isCallActive)
|
|
258
258
|
return a("sendRefusalToTurnOnMic"), e.sendRefusalToTurnOnMic().catch((n) => {
|
|
259
259
|
a("sendRefusalToTurnOnMic: error", n);
|
|
260
260
|
});
|
|
261
|
-
},
|
|
261
|
+
}, Ve = (e) => async ({
|
|
262
262
|
mediaStream: n,
|
|
263
263
|
isP2P: s,
|
|
264
264
|
maxBitrate: r,
|
|
@@ -278,11 +278,11 @@ const he = (e = new Error()) => {
|
|
|
278
278
|
})
|
|
279
279
|
},
|
|
280
280
|
u
|
|
281
|
-
)),
|
|
281
|
+
)), xe = (e) => async ({ isP2P: n = !1 } = {}) => (a("stopShareSipConnector"), e.stopPresentation({
|
|
282
282
|
isP2P: n
|
|
283
283
|
}).catch((s) => {
|
|
284
284
|
a(s);
|
|
285
|
-
})),
|
|
285
|
+
})), $e = (e) => async ({
|
|
286
286
|
mediaStream: n,
|
|
287
287
|
isP2P: s,
|
|
288
288
|
maxBitrate: r,
|
|
@@ -298,21 +298,21 @@ const he = (e = new Error()) => {
|
|
|
298
298
|
simulcastEncodings: c,
|
|
299
299
|
sendEncodings: i
|
|
300
300
|
})
|
|
301
|
-
})),
|
|
301
|
+
})), Xe = (e) => (t) => [...t].map((s) => async () => e(s)), Ge = async ({
|
|
302
302
|
accumulatedKeys: e,
|
|
303
303
|
sendKey: t,
|
|
304
304
|
canRunTask: n
|
|
305
305
|
}) => {
|
|
306
|
-
const r =
|
|
307
|
-
return
|
|
308
|
-
},
|
|
309
|
-
const t = (m,
|
|
310
|
-
if (
|
|
306
|
+
const r = Xe(t)(e);
|
|
307
|
+
return oe(r, n);
|
|
308
|
+
}, He = (e) => (n) => (a("onStartMainCam"), e.onSession("admin-start-main-cam", n)), We = (e) => (n) => (a("onStartMic"), e.onSession("admin-start-mic", n)), je = (e) => (n) => (a("onStopMainCam"), e.onSession("admin-stop-main-cam", n)), Ke = (e) => (n) => (a("onStopMic"), e.onSession("admin-stop-mic", n)), Ye = ({ sipConnector: e }) => {
|
|
309
|
+
const t = (m, R) => ({ isSyncForced: T = !1 }) => {
|
|
310
|
+
if (T) {
|
|
311
311
|
m();
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
|
-
|
|
315
|
-
}, n =
|
|
314
|
+
R();
|
|
315
|
+
}, n = He(e), s = je(e), r = We(e), o = Ke(e);
|
|
316
316
|
let c = () => {
|
|
317
317
|
}, i = () => {
|
|
318
318
|
}, u = () => {
|
|
@@ -320,27 +320,27 @@ const he = (e = new Error()) => {
|
|
|
320
320
|
};
|
|
321
321
|
const g = ({
|
|
322
322
|
onStartMainCamForced: m,
|
|
323
|
-
onStartMainCamNotForced:
|
|
324
|
-
onStopMainCamForced:
|
|
325
|
-
onStopMainCamNotForced:
|
|
326
|
-
onStartMicForced:
|
|
327
|
-
onStartMicNotForced:
|
|
328
|
-
onStopMicForced:
|
|
329
|
-
onStopMicNotForced:
|
|
323
|
+
onStartMainCamNotForced: R,
|
|
324
|
+
onStopMainCamForced: T,
|
|
325
|
+
onStopMainCamNotForced: y,
|
|
326
|
+
onStartMicForced: b,
|
|
327
|
+
onStartMicNotForced: O,
|
|
328
|
+
onStopMicForced: p,
|
|
329
|
+
onStopMicNotForced: h
|
|
330
330
|
}) => {
|
|
331
|
-
const
|
|
331
|
+
const M = t(
|
|
332
332
|
m,
|
|
333
|
-
|
|
333
|
+
R
|
|
334
334
|
);
|
|
335
|
-
c = n(
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
|
|
335
|
+
c = n(M);
|
|
336
|
+
const P = t(
|
|
337
|
+
T,
|
|
338
|
+
y
|
|
339
339
|
);
|
|
340
|
-
i = s(
|
|
341
|
-
const
|
|
342
|
-
u = r(
|
|
343
|
-
const v = t(
|
|
340
|
+
i = s(P);
|
|
341
|
+
const _ = t(b, O);
|
|
342
|
+
u = r(_);
|
|
343
|
+
const v = t(p, h);
|
|
344
344
|
S = o(v);
|
|
345
345
|
}, f = () => {
|
|
346
346
|
c(), i(), u(), S();
|
|
@@ -353,46 +353,47 @@ const he = (e = new Error()) => {
|
|
|
353
353
|
f();
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
|
-
},
|
|
356
|
+
}, dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
357
357
|
__proto__: null,
|
|
358
|
-
PURGATORY_CONFERENCE_NUMBER:
|
|
359
|
-
createSyncMediaState:
|
|
360
|
-
error:
|
|
361
|
-
getExtraHeaders:
|
|
362
|
-
getUserAgent:
|
|
358
|
+
PURGATORY_CONFERENCE_NUMBER: z,
|
|
359
|
+
createSyncMediaState: Ye,
|
|
360
|
+
error: be,
|
|
361
|
+
getExtraHeaders: Oe,
|
|
362
|
+
getUserAgent: Pe,
|
|
363
363
|
hasPurgatory: A,
|
|
364
|
-
resolveAnswerIncomingCall:
|
|
365
|
-
resolveAskPermissionToEnableCam:
|
|
366
|
-
resolveCallToServer:
|
|
367
|
-
resolveConnectToServer:
|
|
368
|
-
resolveDisconnectFromServer:
|
|
364
|
+
resolveAnswerIncomingCall: Ee,
|
|
365
|
+
resolveAskPermissionToEnableCam: Be,
|
|
366
|
+
resolveCallToServer: Re,
|
|
367
|
+
resolveConnectToServer: Te,
|
|
368
|
+
resolveDisconnectFromServer: he,
|
|
369
369
|
resolveGetRemoteStreams: k,
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
370
|
+
resolveOnMoveToParticipants: De,
|
|
371
|
+
resolveOnMoveToSpectators: Ie,
|
|
372
|
+
resolveOnMustStopPresentation: we,
|
|
373
|
+
resolveOnUseLicense: Fe,
|
|
374
|
+
resolveSendMediaState: ke,
|
|
375
|
+
resolveSendRefusalToTurnOnCam: Ue,
|
|
376
|
+
resolveSendRefusalToTurnOnMic: Le,
|
|
377
|
+
resolveStartPresentation: Ve,
|
|
378
|
+
resolveStopShareSipConnector: xe,
|
|
379
|
+
resolveUpdatePresentation: $e,
|
|
379
380
|
resolveUpdateRemoteStreams: U,
|
|
380
|
-
sendDTMFAccumulated:
|
|
381
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
382
|
-
const n =
|
|
381
|
+
sendDTMFAccumulated: Ge
|
|
382
|
+
}, Symbol.toStringTag, { value: "Module" })), ze = (e) => [...e.keys()].map((t) => e.get(t)), Qe = (e, t) => ze(e).find((n) => n.type === t), qe = async (e) => e.getStats().then((t) => {
|
|
383
|
+
const n = Qe(t, "codec");
|
|
383
384
|
return n == null ? void 0 : n.mimeType;
|
|
384
|
-
}),
|
|
385
|
+
}), Je = (e) => e.find((t) => {
|
|
385
386
|
var n;
|
|
386
387
|
return ((n = t == null ? void 0 : t.track) == null ? void 0 : n.kind) === "video";
|
|
387
|
-
}),
|
|
388
|
+
}), J = ae(), Ze = async () => J().catch((e) => {
|
|
388
389
|
a("videoSendingBalancer: error", e);
|
|
389
|
-
}),
|
|
390
|
+
}), en = async (e) => (J.add(e), Ze()), V = async ({
|
|
390
391
|
sender: e,
|
|
391
392
|
scaleResolutionDownBy: t,
|
|
392
393
|
maxBitrate: n,
|
|
393
394
|
onSetParameters: s
|
|
394
|
-
}) =>
|
|
395
|
-
const r =
|
|
395
|
+
}) => en(async () => ne(e, { scaleResolutionDownBy: t, maxBitrate: n }, s)), nn = async ({ sender: e, codec: t }, n) => {
|
|
396
|
+
const r = fe(t);
|
|
396
397
|
return V({
|
|
397
398
|
sender: e,
|
|
398
399
|
maxBitrate: r,
|
|
@@ -411,7 +412,7 @@ const he = (e = new Error()) => {
|
|
|
411
412
|
onSetParameters: s,
|
|
412
413
|
scaleResolutionDownBy: 1
|
|
413
414
|
});
|
|
414
|
-
},
|
|
415
|
+
}, tn = async ({
|
|
415
416
|
sender: e,
|
|
416
417
|
videoTrack: t,
|
|
417
418
|
resolution: n,
|
|
@@ -431,7 +432,7 @@ const he = (e = new Error()) => {
|
|
|
431
432
|
onSetParameters: r,
|
|
432
433
|
scaleResolutionDownBy: u
|
|
433
434
|
});
|
|
434
|
-
},
|
|
435
|
+
}, sn = async ({
|
|
435
436
|
mainCam: e,
|
|
436
437
|
resolutionMainCam: t,
|
|
437
438
|
sender: n,
|
|
@@ -439,12 +440,12 @@ const he = (e = new Error()) => {
|
|
|
439
440
|
codec: r
|
|
440
441
|
}, o) => {
|
|
441
442
|
switch (e) {
|
|
442
|
-
case
|
|
443
|
-
return
|
|
444
|
-
case
|
|
443
|
+
case I.PAUSE_MAIN_CAM:
|
|
444
|
+
return nn({ sender: n, codec: r }, o);
|
|
445
|
+
case I.RESUME_MAIN_CAM:
|
|
445
446
|
return F({ sender: n, videoTrack: s, codec: r }, o);
|
|
446
|
-
case
|
|
447
|
-
return t !== void 0 ?
|
|
447
|
+
case I.MAX_MAIN_CAM_RESOLUTION:
|
|
448
|
+
return t !== void 0 ? tn(
|
|
448
449
|
{ sender: n, videoTrack: s, codec: r, resolution: t },
|
|
449
450
|
o
|
|
450
451
|
) : F({ sender: n, videoTrack: s, codec: r }, o);
|
|
@@ -467,11 +468,11 @@ const he = (e = new Error()) => {
|
|
|
467
468
|
onSetParameters: s,
|
|
468
469
|
ignoreForCodec: r
|
|
469
470
|
}) => {
|
|
470
|
-
const o = n.getSenders(), c =
|
|
471
|
+
const o = n.getSenders(), c = Je(o);
|
|
471
472
|
if (!(c != null && c.track))
|
|
472
473
|
return x;
|
|
473
|
-
const i = await
|
|
474
|
-
return W(i, r) ? x :
|
|
474
|
+
const i = await qe(c);
|
|
475
|
+
return W(i, r) ? x : sn(
|
|
475
476
|
{
|
|
476
477
|
mainCam: e,
|
|
477
478
|
resolutionMainCam: t,
|
|
@@ -481,7 +482,7 @@ const he = (e = new Error()) => {
|
|
|
481
482
|
},
|
|
482
483
|
s
|
|
483
484
|
);
|
|
484
|
-
},
|
|
485
|
+
}, mn = (e, {
|
|
485
486
|
ignoreForCodec: t,
|
|
486
487
|
onSetParameters: n
|
|
487
488
|
} = {}) => {
|
|
@@ -525,20 +526,20 @@ const he = (e = new Error()) => {
|
|
|
525
526
|
};
|
|
526
527
|
};
|
|
527
528
|
export {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
529
|
+
I as EEventsMainCAM,
|
|
530
|
+
Cn as EEventsMic,
|
|
531
|
+
En as EEventsSyncMediaState,
|
|
532
|
+
Rn as EUseLicense,
|
|
533
|
+
Tn as causes,
|
|
534
|
+
hn as constants,
|
|
535
|
+
vn as debug,
|
|
536
|
+
on as default,
|
|
537
|
+
Mn as disableDebug,
|
|
538
|
+
yn as enableDebug,
|
|
539
|
+
_n as eventNames,
|
|
540
|
+
qe as getCodecFromSender,
|
|
541
|
+
bn as hasCanceledCallError,
|
|
542
|
+
mn as resolveVideoSendingBalancer,
|
|
543
|
+
On as setParametersToSender,
|
|
544
|
+
dn as tools
|
|
544
545
|
};
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { default as resolveAskPermissionToEnableCam } from './resolveAskPermissi
|
|
|
10
10
|
export { default as resolveGetRemoteStreams } from './resolveGetRemoteStreams';
|
|
11
11
|
export { default as resolveOnMustStopPresentation } from './resolveOnMustStopPresentation';
|
|
12
12
|
export { default as resolveOnMoveToSpectators } from './resolveOnMoveToSpectators';
|
|
13
|
+
export { default as resolveOnMoveToParticipants } from './resolveOnMoveToParticipants';
|
|
13
14
|
export { default as resolveOnUseLicense } from './resolveOnUseLicense';
|
|
14
15
|
export { default as resolveSendMediaState } from './resolveSendMediaState';
|
|
15
16
|
export { default as resolveSendRefusalToTurnOnCam } from './resolveSendRefusalToTurnOnCam';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sip-connector",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"description": "Module for connect to Vinteo server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webrtc",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@krivega/cancelable-promise": "^1.1.3",
|
|
66
66
|
"@krivega/jssip": "^5.0.0",
|
|
67
67
|
"debug": "^4.3.7",
|
|
68
|
-
"events-constructor": "^1.
|
|
68
|
+
"events-constructor": "^1.3.0",
|
|
69
69
|
"repeated-calls": "^2.3.0",
|
|
70
70
|
"sequent-promises": "^2.0.1",
|
|
71
71
|
"stack-promises": "^2.0.2",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
91
91
|
"eslint-plugin-flowtype": "^8.0.3",
|
|
92
92
|
"eslint-plugin-import": "^2.31.0",
|
|
93
|
-
"eslint-plugin-jest": "^28.
|
|
93
|
+
"eslint-plugin-jest": "^28.9.0",
|
|
94
94
|
"eslint-plugin-prettier": "^5.2.1",
|
|
95
95
|
"eslint-plugin-unicorn": "^56.0.0",
|
|
96
96
|
"husky": "^9.1.6",
|
|
@@ -107,13 +107,13 @@
|
|
|
107
107
|
"typescript": "^5.6.3",
|
|
108
108
|
"vite": "^5.4.10",
|
|
109
109
|
"vite-plugin-dts": "^4.3.0",
|
|
110
|
-
"vite-tsconfig-paths": "^5.0
|
|
110
|
+
"vite-tsconfig-paths": "^5.1.0"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
113
|
"@krivega/cancelable-promise": "^1.1.3",
|
|
114
114
|
"@krivega/jssip": "^5.0.0",
|
|
115
115
|
"debug": "^4.3.7",
|
|
116
|
-
"events-constructor": "^1.
|
|
116
|
+
"events-constructor": "^1.3.0",
|
|
117
117
|
"repeated-calls": "^2.2.1",
|
|
118
118
|
"sequent-promises": "^2.0.1",
|
|
119
119
|
"stack-promises": "^2.0.2",
|