sip-connector 12.0.0 → 12.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-Dq5DrJxd.js → SipConnector-BxDInUHC.js} +141 -140
- package/dist/SipConnector-Ds1fhzNg.cjs +1 -0
- package/dist/SipConnectorFacade/SipConnectorFacade.d.ts +6 -6
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +95 -92
- package/dist/tools/generateSimulcastEncodings.d.ts +2 -2
- package/dist/types.d.ts +13 -1
- package/package.json +12 -12
- package/dist/SipConnector-BWx586hI.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var Z = Object.defineProperty;
|
|
2
2
|
var ee = (n, e, t) => e in n ? Z(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var l = (n, e, t) => ee(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { B as X, N as j, l as
|
|
5
|
-
import { i as ln, j as dn,
|
|
4
|
+
import { B as X, N as j, l as a, E as k, s as ne, a as te, P as se, b as re, S as Je } from "./SipConnector-BxDInUHC.js";
|
|
5
|
+
import { i as ln, j as dn, m as Sn, k as mn, c as Cn, d as fn, f as hn, g as Rn, e as gn, h as pn } from "./SipConnector-BxDInUHC.js";
|
|
6
6
|
import { sequentPromises as oe } from "sequent-promises";
|
|
7
7
|
import { createStackPromises as ce } from "stack-promises";
|
|
8
8
|
import { isCanceledError as ie } from "@krivega/cancelable-promise";
|
|
9
9
|
import { hasCanceledError as ae } from "repeated-calls";
|
|
10
10
|
import { debounce as ue } from "ts-debounce";
|
|
11
|
-
import { default as
|
|
11
|
+
import { default as En } from "debug";
|
|
12
12
|
const x = (n) => {
|
|
13
13
|
const { url: e, cause: t } = n;
|
|
14
14
|
let s = e;
|
|
@@ -41,7 +41,7 @@ const le = (n = new Error()) => {
|
|
|
41
41
|
try {
|
|
42
42
|
e = JSON.stringify(n);
|
|
43
43
|
} catch (t) {
|
|
44
|
-
|
|
44
|
+
a("failed to stringify message", t);
|
|
45
45
|
}
|
|
46
46
|
return e;
|
|
47
47
|
}, Se = (n = new Error()) => {
|
|
@@ -61,8 +61,8 @@ const le = (n = new Error()) => {
|
|
|
61
61
|
isRegistered: r,
|
|
62
62
|
isPresentationCall: o
|
|
63
63
|
}) => {
|
|
64
|
-
const c = [],
|
|
65
|
-
return c.push(`X-Vinteo-Mic-State: ${
|
|
64
|
+
const c = [], i = t ? "0" : "1", u = s ? "0" : "1";
|
|
65
|
+
return c.push(`X-Vinteo-Mic-State: ${i}`, `X-Vinteo-MainCam-State: ${u}`), r || c.push("X-Vinteo-Purgatory-Call: yes"), n && c.push(`X-Vinteo-Session: ${n}`), o && c.push("X-Vinteo-Presentation-Call: yes"), e && c.push(`X-Vinteo-Remote: ${e}`), c;
|
|
66
66
|
}, fe = "[@*!|]", he = "_", Re = (n) => {
|
|
67
67
|
let e = n;
|
|
68
68
|
return e = e.replaceAll(new RegExp(fe, "g"), he), e;
|
|
@@ -87,7 +87,7 @@ const le = (n = new Error()) => {
|
|
|
87
87
|
}) => {
|
|
88
88
|
const r = ye(e)(n);
|
|
89
89
|
return oe(r, t);
|
|
90
|
-
}, Te = (n) => (t) => (
|
|
90
|
+
}, Te = (n) => (t) => (a("onStartMainCam"), n.onSession("admin-start-main-cam", t)), be = (n) => (t) => (a("onStartMic"), n.onSession("admin-start-mic", t)), Me = (n) => (t) => (a("onStopMainCam"), n.onSession("admin-stop-main-cam", t)), _e = (n) => (t) => (a("onStopMic"), n.onSession("admin-stop-mic", t)), Ae = ({ sipConnector: n }) => {
|
|
91
91
|
const e = (f, g) => ({ isSyncForced: p = !1 }) => {
|
|
92
92
|
if (p) {
|
|
93
93
|
f();
|
|
@@ -96,7 +96,7 @@ const le = (n = new Error()) => {
|
|
|
96
96
|
g();
|
|
97
97
|
}, t = Te(n), s = Me(n), r = be(n), o = _e(n);
|
|
98
98
|
let c = () => {
|
|
99
|
-
},
|
|
99
|
+
}, i = () => {
|
|
100
100
|
}, u = () => {
|
|
101
101
|
}, S = () => {
|
|
102
102
|
};
|
|
@@ -107,8 +107,8 @@ const le = (n = new Error()) => {
|
|
|
107
107
|
onStopMainCamNotForced: b,
|
|
108
108
|
onStartMicForced: _,
|
|
109
109
|
onStartMicNotForced: A,
|
|
110
|
-
onStopMicForced:
|
|
111
|
-
onStopMicNotForced:
|
|
110
|
+
onStopMicForced: v,
|
|
111
|
+
onStopMicNotForced: O
|
|
112
112
|
}) => {
|
|
113
113
|
const y = e(
|
|
114
114
|
f,
|
|
@@ -119,13 +119,13 @@ const le = (n = new Error()) => {
|
|
|
119
119
|
p,
|
|
120
120
|
b
|
|
121
121
|
);
|
|
122
|
-
|
|
122
|
+
i = s(E);
|
|
123
123
|
const w = e(_, A);
|
|
124
124
|
u = r(w);
|
|
125
|
-
const M = e(
|
|
125
|
+
const M = e(v, O);
|
|
126
126
|
S = o(M);
|
|
127
127
|
}, m = () => {
|
|
128
|
-
c(),
|
|
128
|
+
c(), i(), u(), S();
|
|
129
129
|
};
|
|
130
130
|
return {
|
|
131
131
|
start: (f) => {
|
|
@@ -144,8 +144,8 @@ const le = (n = new Error()) => {
|
|
|
144
144
|
getUserAgent: pe,
|
|
145
145
|
hasPurgatory: P,
|
|
146
146
|
sendDTMFAccumulated: Ee
|
|
147
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
148
|
-
const t =
|
|
147
|
+
}, Symbol.toStringTag, { value: "Module" })), ve = (n) => [...n.keys()].map((e) => n.get(e)), Oe = (n, e) => ve(n).find((t) => t.type === e), Ne = async (n) => n.getStats().then((e) => {
|
|
148
|
+
const t = Oe(e, "codec");
|
|
149
149
|
return t == null ? void 0 : t.mimeType;
|
|
150
150
|
}), Be = (n) => n.find((e) => {
|
|
151
151
|
var t;
|
|
@@ -158,10 +158,10 @@ const le = (n = new Error()) => {
|
|
|
158
158
|
targetSize: e,
|
|
159
159
|
codec: t
|
|
160
160
|
}) => {
|
|
161
|
-
const s = n.getSettings(), r = s.width, o = s.height, c = r / e.width,
|
|
161
|
+
const s = n.getSettings(), r = s.width, o = s.height, c = r / e.width, i = o / e.height, u = Math.max(c, i, Le), S = z(e.width, t);
|
|
162
162
|
return { scaleResolutionDownBy: u, maxBitrate: S };
|
|
163
163
|
}, J = ce(), xe = async () => J().catch((n) => {
|
|
164
|
-
|
|
164
|
+
a("videoSendingBalancer: error", n);
|
|
165
165
|
}), Ve = async (n) => (J.add(n), xe()), V = async ({
|
|
166
166
|
sender: n,
|
|
167
167
|
scaleResolutionDownBy: e,
|
|
@@ -180,10 +180,10 @@ const le = (n = new Error()) => {
|
|
|
180
180
|
videoTrack: e,
|
|
181
181
|
codec: t
|
|
182
182
|
}, s) => {
|
|
183
|
-
const c = e.getSettings().width,
|
|
183
|
+
const c = e.getSettings().width, i = z(c, t);
|
|
184
184
|
return V({
|
|
185
185
|
sender: n,
|
|
186
|
-
maxBitrate:
|
|
186
|
+
maxBitrate: i,
|
|
187
187
|
onSetParameters: s,
|
|
188
188
|
scaleResolutionDownBy: 1
|
|
189
189
|
});
|
|
@@ -193,7 +193,7 @@ const le = (n = new Error()) => {
|
|
|
193
193
|
resolution: t,
|
|
194
194
|
codec: s
|
|
195
195
|
}, r) => {
|
|
196
|
-
const [o, c] = t.split("x"), { maxBitrate:
|
|
196
|
+
const [o, c] = t.split("x"), { maxBitrate: i, scaleResolutionDownBy: u } = Q({
|
|
197
197
|
videoTrack: e,
|
|
198
198
|
codec: s,
|
|
199
199
|
targetSize: {
|
|
@@ -203,7 +203,7 @@ const le = (n = new Error()) => {
|
|
|
203
203
|
});
|
|
204
204
|
return V({
|
|
205
205
|
sender: n,
|
|
206
|
-
maxBitrate:
|
|
206
|
+
maxBitrate: i,
|
|
207
207
|
onSetParameters: r,
|
|
208
208
|
scaleResolutionDownBy: u
|
|
209
209
|
});
|
|
@@ -246,13 +246,13 @@ const le = (n = new Error()) => {
|
|
|
246
246
|
const o = t.getSenders(), c = Be(o);
|
|
247
247
|
if (!(c != null && c.track))
|
|
248
248
|
return $;
|
|
249
|
-
const
|
|
250
|
-
return K(
|
|
249
|
+
const i = await Ne(c);
|
|
250
|
+
return K(i, r) ? $ : Xe(
|
|
251
251
|
{
|
|
252
252
|
mainCam: n,
|
|
253
253
|
resolutionMainCam: e,
|
|
254
254
|
sender: c,
|
|
255
|
-
codec:
|
|
255
|
+
codec: i,
|
|
256
256
|
videoTrack: c.track
|
|
257
257
|
},
|
|
258
258
|
s
|
|
@@ -307,31 +307,33 @@ const le = (n = new Error()) => {
|
|
|
307
307
|
if (e && e.length > 0) {
|
|
308
308
|
const s = t ?? [], r = je(n);
|
|
309
309
|
return e.forEach((o, c) => {
|
|
310
|
-
const
|
|
310
|
+
const i = s[c] ?? {};
|
|
311
|
+
i.active = !0, o.rid !== void 0 && (i.rid = o.rid), o.scalabilityMode !== void 0 && (i.scalabilityMode = o.scalabilityMode);
|
|
312
|
+
const { maxBitrate: u, scaleResolutionDownBy: S } = Q({
|
|
311
313
|
videoTrack: r,
|
|
312
314
|
targetSize: {
|
|
313
315
|
width: o.width,
|
|
314
316
|
height: o.height
|
|
315
317
|
}
|
|
316
318
|
});
|
|
317
|
-
|
|
319
|
+
i.maxBitrate = u, i.scaleResolutionDownBy = S, s[c] = i;
|
|
318
320
|
}), s;
|
|
319
321
|
}
|
|
320
322
|
return t;
|
|
321
|
-
}, We = (n, e) => [...n, ...e].filter((r, o, c) => o === c.findIndex((
|
|
323
|
+
}, We = (n, e) => [...n, ...e].filter((r, o, c) => o === c.findIndex((i) => i.clockRate === r.clockRate && i.mimeType === r.mimeType && i.channels === r.channels && i.sdpFmtpLine === r.sdpFmtpLine)), Ge = (n) => {
|
|
322
324
|
const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs, r = t === null ? [] : t.codecs;
|
|
323
325
|
return We(s, r);
|
|
324
326
|
}, Ke = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
|
|
325
|
-
const r = e.indexOf(t.mimeType), o = e.indexOf(s.mimeType), c = r === -1 ? Number.MAX_VALUE : r,
|
|
326
|
-
return c -
|
|
327
|
+
const r = e.indexOf(t.mimeType), o = e.indexOf(s.mimeType), c = r === -1 ? Number.MAX_VALUE : r, i = o === -1 ? Number.MAX_VALUE : o;
|
|
328
|
+
return c - i;
|
|
327
329
|
}), qe = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), B = (n, {
|
|
328
330
|
preferredMimeTypesVideoCodecs: e,
|
|
329
331
|
excludeMimeTypesVideoCodecs: t
|
|
330
332
|
}) => async (s) => {
|
|
331
333
|
var r;
|
|
332
334
|
if (typeof s.setCodecPreferences == "function" && ((r = s.sender.track) == null ? void 0 : r.kind) === "video" && (e !== void 0 && (e == null ? void 0 : e.length) > 0 || t !== void 0 && (t == null ? void 0 : t.length) > 0)) {
|
|
333
|
-
const o = Ge("video"), c = qe(o, t),
|
|
334
|
-
s.setCodecPreferences(
|
|
335
|
+
const o = Ge("video"), c = qe(o, t), i = Ke(c, e);
|
|
336
|
+
s.setCodecPreferences(i);
|
|
335
337
|
}
|
|
336
338
|
Object.keys(n).length > 0 && await te(s.sender, n);
|
|
337
339
|
}, L = (n) => {
|
|
@@ -354,21 +356,21 @@ class cn {
|
|
|
354
356
|
sipServerUrl: r,
|
|
355
357
|
remoteAddress: o,
|
|
356
358
|
displayName: c,
|
|
357
|
-
name:
|
|
359
|
+
name: i,
|
|
358
360
|
password: u,
|
|
359
361
|
isRegisteredUser: S,
|
|
360
362
|
isDisconnectOnFail: C
|
|
361
363
|
} = e;
|
|
362
|
-
return
|
|
364
|
+
return a("connectToServer", e), this.sipConnector.connect({
|
|
363
365
|
userAgent: t,
|
|
364
366
|
sipWebSocketServerURL: s,
|
|
365
367
|
sipServerUrl: r,
|
|
366
368
|
remoteAddress: o,
|
|
367
369
|
displayName: c,
|
|
368
370
|
password: u,
|
|
369
|
-
user:
|
|
371
|
+
user: i,
|
|
370
372
|
register: S
|
|
371
|
-
}).then((m) => (
|
|
373
|
+
}).then((m) => (a("connectToServer then"), { ua: m, isSuccessful: !0 })).catch(async (m) => (a("connectToServer catch: error", m), C === !0 ? this.sipConnector.disconnect().then(() => L(m)).catch(() => L(m)) : L(m)));
|
|
372
374
|
});
|
|
373
375
|
l(this, "callToServer", async (e) => {
|
|
374
376
|
const {
|
|
@@ -377,7 +379,7 @@ class cn {
|
|
|
377
379
|
extraHeaders: r,
|
|
378
380
|
iceServers: o,
|
|
379
381
|
contentHint: c,
|
|
380
|
-
simulcastEncodings:
|
|
382
|
+
simulcastEncodings: i,
|
|
381
383
|
degradationPreference: u,
|
|
382
384
|
sendEncodings: S,
|
|
383
385
|
setRemoteStreams: C,
|
|
@@ -392,7 +394,7 @@ class cn {
|
|
|
392
394
|
onReadyRemoteStreams: C
|
|
393
395
|
}), A = this.resolveHandleReadyRemoteStreams({
|
|
394
396
|
onReadyRemoteStreams: _
|
|
395
|
-
}),
|
|
397
|
+
}), v = B(
|
|
396
398
|
{
|
|
397
399
|
degradationPreference: u
|
|
398
400
|
},
|
|
@@ -401,35 +403,35 @@ class cn {
|
|
|
401
403
|
excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
|
|
402
404
|
}
|
|
403
405
|
);
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
+
a("callToServer", e);
|
|
407
|
+
const O = async () => (a("startCall"), this.sipConnector.call({
|
|
406
408
|
mediaStream: s,
|
|
407
409
|
extraHeaders: r,
|
|
408
410
|
iceServers: o,
|
|
409
411
|
contentHint: c,
|
|
410
412
|
sendEncodings: N({
|
|
411
413
|
mediaStream: s,
|
|
412
|
-
simulcastEncodings:
|
|
414
|
+
simulcastEncodings: i,
|
|
413
415
|
sendEncodings: S
|
|
414
416
|
}),
|
|
415
417
|
number: t,
|
|
416
|
-
onAddedTransceiver:
|
|
418
|
+
onAddedTransceiver: v,
|
|
417
419
|
ontrack: A
|
|
418
420
|
}));
|
|
419
421
|
let y = !1, E;
|
|
420
|
-
const M = (
|
|
421
|
-
|
|
422
|
+
const M = (a("subscribeEnterConference: onEnterConference", f), R ?? f ? this.sipConnector.onSession("enterRoom", ({ room: d }) => {
|
|
423
|
+
a("enterRoom", { _room: d, isSuccessProgressCall: y }), E = d, P(E) ? R && R() : f && f({ isSuccessProgressCall: y });
|
|
422
424
|
}) : () => {
|
|
423
|
-
}), D = (d) => (
|
|
425
|
+
}), D = (d) => (a("onSuccess"), y = !0, _(), T && T({ isPurgatory: P(E) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
|
|
424
426
|
M(), b && b();
|
|
425
427
|
}), d), I = (d) => {
|
|
426
|
-
throw
|
|
428
|
+
throw a("onFail"), g && g(), M(), d;
|
|
427
429
|
}, F = () => {
|
|
428
|
-
|
|
430
|
+
a("onFinish"), p && p();
|
|
429
431
|
};
|
|
430
|
-
return
|
|
432
|
+
return a("onBeforeProgressCall"), m && m(t), O().then(D).catch((d) => I(d)).finally(F);
|
|
431
433
|
});
|
|
432
|
-
l(this, "disconnectFromServer", async () => this.sipConnector.disconnect().then(() => (
|
|
434
|
+
l(this, "disconnectFromServer", async () => this.sipConnector.disconnect().then(() => (a("disconnectFromServer: then"), { isSuccessful: !0 })).catch((e) => (a("disconnectFromServer: catch", e), { isSuccessful: !1 })));
|
|
433
435
|
l(this, "answerIncomingCall", async (e) => {
|
|
434
436
|
const {
|
|
435
437
|
mediaStream: t,
|
|
@@ -437,7 +439,7 @@ class cn {
|
|
|
437
439
|
iceServers: r,
|
|
438
440
|
contentHint: o,
|
|
439
441
|
simulcastEncodings: c,
|
|
440
|
-
degradationPreference:
|
|
442
|
+
degradationPreference: i,
|
|
441
443
|
sendEncodings: u,
|
|
442
444
|
setRemoteStreams: S,
|
|
443
445
|
onBeforeProgressCall: C,
|
|
@@ -453,15 +455,15 @@ class cn {
|
|
|
453
455
|
onReadyRemoteStreams: b
|
|
454
456
|
}), A = B(
|
|
455
457
|
{
|
|
456
|
-
degradationPreference:
|
|
458
|
+
degradationPreference: i
|
|
457
459
|
},
|
|
458
460
|
{
|
|
459
461
|
preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
|
|
460
462
|
excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
|
|
461
463
|
}
|
|
462
464
|
);
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
+
a("answerIncomingCall", e);
|
|
466
|
+
const v = async () => this.sipConnector.answerToIncomingCall({
|
|
465
467
|
mediaStream: t,
|
|
466
468
|
extraHeaders: s,
|
|
467
469
|
iceServers: r,
|
|
@@ -473,26 +475,26 @@ class cn {
|
|
|
473
475
|
}),
|
|
474
476
|
onAddedTransceiver: A,
|
|
475
477
|
ontrack: _
|
|
476
|
-
}),
|
|
478
|
+
}), O = () => {
|
|
477
479
|
const { remoteCallerData: d } = this.sipConnector;
|
|
478
480
|
return d.incomingNumber;
|
|
479
481
|
};
|
|
480
482
|
let y = !1, E;
|
|
481
|
-
const M = (
|
|
482
|
-
|
|
483
|
+
const M = (a("subscribeEnterConference: onEnterConference", R), T ?? R ? this.sipConnector.onSession("enterRoom", (d) => {
|
|
484
|
+
a("enterRoom", { _room: d, isSuccessProgressCall: y }), E = d, P(E) ? T && T() : R && R({ isSuccessProgressCall: y });
|
|
483
485
|
}) : () => {
|
|
484
|
-
}), D = (d) => (
|
|
486
|
+
}), D = (d) => (a("onSuccess"), y = !0, b(), m && m({ isPurgatory: P(E) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
|
|
485
487
|
M(), p && p();
|
|
486
488
|
}), d), I = (d) => {
|
|
487
|
-
throw
|
|
489
|
+
throw a("onFail"), f && f(), M(), d;
|
|
488
490
|
}, F = () => {
|
|
489
|
-
|
|
491
|
+
a("onFinish"), g && g();
|
|
490
492
|
};
|
|
491
|
-
if (
|
|
492
|
-
const d =
|
|
493
|
+
if (a("onBeforeProgressCall"), C) {
|
|
494
|
+
const d = O();
|
|
493
495
|
C(d);
|
|
494
496
|
}
|
|
495
|
-
return
|
|
497
|
+
return v().then(D).catch((d) => I(d)).finally(F);
|
|
496
498
|
});
|
|
497
499
|
l(this, "updatePresentation", async ({
|
|
498
500
|
mediaStream: e,
|
|
@@ -501,7 +503,7 @@ class cn {
|
|
|
501
503
|
contentHint: r,
|
|
502
504
|
simulcastEncodings: o,
|
|
503
505
|
degradationPreference: c,
|
|
504
|
-
sendEncodings:
|
|
506
|
+
sendEncodings: i,
|
|
505
507
|
preferredMimeTypesVideoCodecs: u,
|
|
506
508
|
excludeMimeTypesVideoCodecs: S
|
|
507
509
|
}) => {
|
|
@@ -514,14 +516,14 @@ class cn {
|
|
|
514
516
|
excludeMimeTypesVideoCodecs: S
|
|
515
517
|
}
|
|
516
518
|
);
|
|
517
|
-
return
|
|
519
|
+
return a("updatePresentation"), this.sipConnector.updatePresentation(e, {
|
|
518
520
|
isP2P: t,
|
|
519
521
|
maxBitrate: s,
|
|
520
522
|
contentHint: r,
|
|
521
523
|
sendEncodings: N({
|
|
522
524
|
mediaStream: e,
|
|
523
525
|
simulcastEncodings: o,
|
|
524
|
-
sendEncodings:
|
|
526
|
+
sendEncodings: i
|
|
525
527
|
}),
|
|
526
528
|
onAddedTransceiver: C
|
|
527
529
|
});
|
|
@@ -533,7 +535,7 @@ class cn {
|
|
|
533
535
|
contentHint: r,
|
|
534
536
|
simulcastEncodings: o,
|
|
535
537
|
degradationPreference: c,
|
|
536
|
-
sendEncodings:
|
|
538
|
+
sendEncodings: i,
|
|
537
539
|
preferredMimeTypesVideoCodecs: u,
|
|
538
540
|
excludeMimeTypesVideoCodecs: S
|
|
539
541
|
}, C) => {
|
|
@@ -546,7 +548,7 @@ class cn {
|
|
|
546
548
|
excludeMimeTypesVideoCodecs: S
|
|
547
549
|
}
|
|
548
550
|
);
|
|
549
|
-
return
|
|
551
|
+
return a("startPresentation"), this.sipConnector.startPresentation(
|
|
550
552
|
e,
|
|
551
553
|
{
|
|
552
554
|
isP2P: t,
|
|
@@ -555,28 +557,28 @@ class cn {
|
|
|
555
557
|
sendEncodings: N({
|
|
556
558
|
mediaStream: e,
|
|
557
559
|
simulcastEncodings: o,
|
|
558
|
-
sendEncodings:
|
|
560
|
+
sendEncodings: i
|
|
559
561
|
}),
|
|
560
562
|
onAddedTransceiver: m
|
|
561
563
|
},
|
|
562
564
|
C
|
|
563
565
|
);
|
|
564
566
|
});
|
|
565
|
-
l(this, "stopShareSipConnector", async ({ isP2P: e = !1 } = {}) => (
|
|
567
|
+
l(this, "stopShareSipConnector", async ({ isP2P: e = !1 } = {}) => (a("stopShareSipConnector"), this.sipConnector.stopPresentation({
|
|
566
568
|
isP2P: e
|
|
567
569
|
}).catch((t) => {
|
|
568
|
-
|
|
570
|
+
a(t);
|
|
569
571
|
})));
|
|
570
572
|
l(this, "sendRefusalToTurnOnMic", async () => {
|
|
571
573
|
if (this.sipConnector.isCallActive)
|
|
572
|
-
return
|
|
573
|
-
|
|
574
|
+
return a("sendRefusalToTurnOnMic"), this.sipConnector.sendRefusalToTurnOnMic().catch((e) => {
|
|
575
|
+
a("sendRefusalToTurnOnMic: error", e);
|
|
574
576
|
});
|
|
575
577
|
});
|
|
576
578
|
l(this, "sendRefusalToTurnOnCam", async () => {
|
|
577
579
|
if (this.sipConnector.isCallActive)
|
|
578
|
-
return
|
|
579
|
-
|
|
580
|
+
return a("sendRefusalToTurnOnCam"), this.sipConnector.sendRefusalToTurnOnCam().catch((e) => {
|
|
581
|
+
a("sendRefusalToTurnOnCam: error", e);
|
|
580
582
|
});
|
|
581
583
|
});
|
|
582
584
|
l(this, "sendMediaState", async ({
|
|
@@ -584,7 +586,7 @@ class cn {
|
|
|
584
586
|
isEnabledMic: t
|
|
585
587
|
}) => {
|
|
586
588
|
if (this.sipConnector.isCallActive)
|
|
587
|
-
return
|
|
589
|
+
return a("sendMediaState"), this.sipConnector.sendMediaState({ cam: e, mic: t });
|
|
588
590
|
});
|
|
589
591
|
l(this, "replaceMediaStream", async (e, {
|
|
590
592
|
deleteExisting: t,
|
|
@@ -592,19 +594,19 @@ class cn {
|
|
|
592
594
|
forceRenegotiation: r,
|
|
593
595
|
contentHint: o,
|
|
594
596
|
simulcastEncodings: c,
|
|
595
|
-
degradationPreference:
|
|
597
|
+
degradationPreference: i,
|
|
596
598
|
sendEncodings: u
|
|
597
599
|
} = {}) => {
|
|
598
600
|
const S = B(
|
|
599
601
|
{
|
|
600
|
-
degradationPreference:
|
|
602
|
+
degradationPreference: i
|
|
601
603
|
},
|
|
602
604
|
{
|
|
603
605
|
preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
|
|
604
606
|
excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
|
|
605
607
|
}
|
|
606
608
|
);
|
|
607
|
-
return
|
|
609
|
+
return a("replaceMediaStream"), this.sipConnector.replaceMediaStream(e, {
|
|
608
610
|
deleteExisting: t,
|
|
609
611
|
addMissing: s,
|
|
610
612
|
forceRenegotiation: r,
|
|
@@ -619,24 +621,24 @@ class cn {
|
|
|
619
621
|
});
|
|
620
622
|
l(this, "askPermissionToEnableCam", async () => {
|
|
621
623
|
if (this.sipConnector.isCallActive)
|
|
622
|
-
return
|
|
624
|
+
return a("askPermissionToEnableCam"), this.sipConnector.askPermissionToEnableCam();
|
|
623
625
|
});
|
|
624
626
|
l(this, "resolveHandleReadyRemoteStreamsDebounced", ({
|
|
625
627
|
onReadyRemoteStreams: e
|
|
626
628
|
}) => ue(() => {
|
|
627
629
|
const t = this.sipConnector.getRemoteStreams();
|
|
628
|
-
|
|
630
|
+
a("remoteStreams", t), t && e(t);
|
|
629
631
|
}, 200));
|
|
630
632
|
l(this, "resolveHandleReadyRemoteStreams", ({
|
|
631
633
|
onReadyRemoteStreams: e
|
|
632
634
|
}) => ({ track: t }) => {
|
|
633
635
|
Ye(t) && e();
|
|
634
636
|
});
|
|
635
|
-
l(this, "getRemoteStreams", () => (
|
|
636
|
-
l(this, "onUseLicense", (e) => (
|
|
637
|
-
l(this, "onMustStopPresentation", (e) => (
|
|
638
|
-
l(this, "onMoveToSpectators", (e) => (
|
|
639
|
-
l(this, "onMoveToParticipants", (e) => (
|
|
637
|
+
l(this, "getRemoteStreams", () => (a("getRemoteStreams"), this.sipConnector.getRemoteStreams()));
|
|
638
|
+
l(this, "onUseLicense", (e) => (a("onUseLicense"), this.sipConnector.onSession("useLicense", e)));
|
|
639
|
+
l(this, "onMustStopPresentation", (e) => (a("onMustStopPresentation"), this.sipConnector.onSession("mustStopPresentation", e)));
|
|
640
|
+
l(this, "onMoveToSpectators", (e) => (a("onMoveToSpectators"), this.sipConnector.onSession(se, e)));
|
|
641
|
+
l(this, "onMoveToParticipants", (e) => (a("onMoveToParticipants"), this.sipConnector.onSession(re, e)));
|
|
640
642
|
this.sipConnector = e, this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s;
|
|
641
643
|
}
|
|
642
644
|
}
|
|
@@ -644,17 +646,18 @@ export {
|
|
|
644
646
|
k as EEventsMainCAM,
|
|
645
647
|
ln as EEventsMic,
|
|
646
648
|
dn as EEventsSyncMediaState,
|
|
647
|
-
Sn as
|
|
649
|
+
Sn as EMimeTypesVideoCodecs,
|
|
650
|
+
mn as EUseLicense,
|
|
648
651
|
cn as SipConnectorFacade,
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
+
Cn as causes,
|
|
653
|
+
fn as constants,
|
|
654
|
+
En as debug,
|
|
652
655
|
Je as default,
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
+
hn as disableDebug,
|
|
657
|
+
Rn as enableDebug,
|
|
658
|
+
gn as eventNames,
|
|
656
659
|
Ne as getCodecFromSender,
|
|
657
|
-
|
|
660
|
+
pn as hasCanceledCallError,
|
|
658
661
|
on as resolveVideoSendingBalancer,
|
|
659
662
|
te as setParametersToSender,
|
|
660
663
|
rn as tools
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TSimulcastEncoding } from '../types';
|
|
2
2
|
declare const generateSimulcastEncodings: ({ mediaStream, simulcastEncodings, sendEncodings, }: {
|
|
3
3
|
mediaStream: MediaStream;
|
|
4
|
-
simulcastEncodings?:
|
|
4
|
+
simulcastEncodings?: TSimulcastEncoding[];
|
|
5
5
|
sendEncodings?: RTCRtpEncodingParameters[];
|
|
6
6
|
}) => RTCRtpEncodingParameters[] | undefined;
|
|
7
7
|
export default generateSimulcastEncodings;
|
package/dist/types.d.ts
CHANGED
|
@@ -53,4 +53,16 @@ export type TSize = {
|
|
|
53
53
|
width: number;
|
|
54
54
|
height: number;
|
|
55
55
|
};
|
|
56
|
-
export type
|
|
56
|
+
export type TSimulcastEncoding = TSize & {
|
|
57
|
+
rid?: string;
|
|
58
|
+
scalabilityMode?: string;
|
|
59
|
+
};
|
|
60
|
+
export declare enum EMimeTypesVideoCodecs {
|
|
61
|
+
VP8 = "video/VP8",
|
|
62
|
+
VP9 = "video/VP9",
|
|
63
|
+
H264 = "video/H264",
|
|
64
|
+
AV1 = "video/AV1",
|
|
65
|
+
rtx = "video/rtx",
|
|
66
|
+
red = "video/red",
|
|
67
|
+
flexfec03 = "video/flexfec-03"
|
|
68
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sip-connector",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.2.0",
|
|
4
4
|
"description": "Module for connect to Vinteo server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webrtc",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@krivega/cancelable-promise": "^1.1.3",
|
|
66
|
-
"@krivega/jssip": "^5.0.
|
|
66
|
+
"@krivega/jssip": "^5.0.4",
|
|
67
67
|
"debug": "^4.3.7",
|
|
68
68
|
"events-constructor": "^1.3.0",
|
|
69
69
|
"repeated-calls": "^2.3.0",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@babel/preset-typescript": "^7.26.0",
|
|
77
|
-
"@commitlint/cli": "^19.
|
|
78
|
-
"@commitlint/config-conventional": "^19.
|
|
79
|
-
"@nabla/vite-plugin-eslint": "^2.0.
|
|
77
|
+
"@commitlint/cli": "^19.6.0",
|
|
78
|
+
"@commitlint/config-conventional": "^19.6.0",
|
|
79
|
+
"@nabla/vite-plugin-eslint": "^2.0.5",
|
|
80
80
|
"@types/debug": "^4.1.12",
|
|
81
81
|
"@types/dom-mediacapture-transform": "^0.1.10",
|
|
82
82
|
"@types/jest": "^29.5.14",
|
|
@@ -92,26 +92,26 @@
|
|
|
92
92
|
"eslint-plugin-import": "^2.31.0",
|
|
93
93
|
"eslint-plugin-jest": "^28.9.0",
|
|
94
94
|
"eslint-plugin-prettier": "^5.2.1",
|
|
95
|
-
"eslint-plugin-unicorn": "^56.0.
|
|
96
|
-
"husky": "^9.1.
|
|
95
|
+
"eslint-plugin-unicorn": "^56.0.1",
|
|
96
|
+
"husky": "^9.1.7",
|
|
97
97
|
"jest": "^29.7.0",
|
|
98
98
|
"jest-environment-jsdom": "^29.7.0",
|
|
99
99
|
"jest-extended": "^4.0.2",
|
|
100
100
|
"jest-junit": "^16.0.0",
|
|
101
101
|
"lint-staged": "^15.2.10",
|
|
102
|
-
"prettier": "^3.
|
|
102
|
+
"prettier": "^3.4.1",
|
|
103
103
|
"standard-version": "^9.5.0",
|
|
104
104
|
"ts-jest": "^29.2.5",
|
|
105
105
|
"ts-node": "^10.9.2",
|
|
106
106
|
"tsc-files": "^1.1.4",
|
|
107
|
-
"typescript": "^5.
|
|
108
|
-
"vite": "^
|
|
107
|
+
"typescript": "^5.7.2",
|
|
108
|
+
"vite": "^6.0.1",
|
|
109
109
|
"vite-plugin-dts": "^4.3.0",
|
|
110
|
-
"vite-tsconfig-paths": "^5.1.
|
|
110
|
+
"vite-tsconfig-paths": "^5.1.3"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
113
|
"@krivega/cancelable-promise": "^1.1.3",
|
|
114
|
-
"@krivega/jssip": "^5.0.
|
|
114
|
+
"@krivega/jssip": "^5.0.4",
|
|
115
115
|
"debug": "^4.3.7",
|
|
116
116
|
"events-constructor": "^1.3.0",
|
|
117
117
|
"repeated-calls": "^2.2.1",
|