sip-connector 14.0.1-0 → 14.1.0-alpha.1
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/ApiManager/@ApiManager.d.ts +58 -0
- package/dist/ApiManager/constants.d.ts +71 -0
- package/dist/ApiManager/eventNames.d.ts +33 -0
- package/dist/ApiManager/index.d.ts +2 -0
- package/dist/ApiManager/types.d.ts +99 -0
- package/dist/CallManager/@CallManager.d.ts +26 -0
- package/dist/CallManager/AbstractCallStrategy.d.ts +47 -0
- package/dist/CallManager/MCUCallStrategy.d.ts +30 -0
- package/dist/CallManager/RemoteStreamsManager.d.ts +8 -0
- package/dist/CallManager/causes.d.ts +12 -0
- package/dist/CallManager/eventNames.d.ts +45 -0
- package/dist/CallManager/hasCanceledCallError.d.ts +2 -0
- package/dist/CallManager/index.d.ts +5 -0
- package/dist/CallManager/types.d.ts +59 -0
- package/dist/ConnectionManager/@ConnectionManager.d.ts +47 -0
- package/dist/ConnectionManager/ConfigurationManager.d.ts +60 -0
- package/dist/ConnectionManager/ConnectionFlow.d.ts +83 -0
- package/dist/ConnectionManager/ConnectionStateMachine.d.ts +61 -0
- package/dist/ConnectionManager/RegistrationManager.d.ts +17 -0
- package/dist/ConnectionManager/SipOperations.d.ts +32 -0
- package/dist/ConnectionManager/UAFactory.d.ts +50 -0
- package/dist/ConnectionManager/eventNames.d.ts +16 -0
- package/dist/ConnectionManager/index.d.ts +3 -0
- package/dist/IncomingCallManager/@IncomingCallManager.d.ts +36 -0
- package/dist/IncomingCallManager/eventNames.d.ts +13 -0
- package/dist/IncomingCallManager/index.d.ts +2 -0
- package/dist/PresentationManager/@PresentationManager.d.ts +47 -0
- package/dist/PresentationManager/constants.d.ts +1 -0
- package/dist/PresentationManager/eventNames.d.ts +11 -0
- package/dist/PresentationManager/index.d.ts +1 -0
- package/dist/PresentationManager/types.d.ts +2 -0
- package/dist/SipConnector-CK3GgjXE.js +2492 -0
- package/dist/SipConnector-CwI8aFEA.cjs +1 -0
- package/dist/SipConnector.d.ts +107 -0
- package/dist/{src/SipConnectorFacade → SipConnectorFacade}/SipConnectorFacade.d.ts +34 -25
- package/dist/{src/__fixtures__ → __fixtures__}/BaseSession.mock.d.ts +9 -9
- package/dist/{src/__fixtures__ → __fixtures__}/RTCSessionMock.d.ts +25 -20
- package/dist/{src/__fixtures__ → __fixtures__}/UA.mock.d.ts +23 -25
- package/dist/{src/__fixtures__ → __fixtures__}/index.d.ts +4 -4
- package/dist/{src/__fixtures__ → __fixtures__}/jssip.mock.d.ts +3 -3
- package/dist/doMock.cjs +1 -1
- package/dist/{src/doMock.d.ts → doMock.d.ts} +1 -0
- package/dist/doMock.js +248 -217
- package/dist/index.cjs +1 -1
- package/dist/{src/index.d.ts → index.d.ts} +3 -1
- package/dist/index.js +529 -436
- package/dist/{src/tools → tools}/__fixtures__/connectToServer.d.ts +2 -2
- package/dist/{src/tools → tools}/index.d.ts +2 -2
- package/dist/{src/tools/sendDTMFAccumulated.d.ts → tools/sendDtmfFAccumulated.d.ts} +2 -2
- package/package.json +27 -33
- package/dist/SipConnector-CJN8qKAC.js +0 -1316
- package/dist/SipConnector-DO0YvSq6.cjs +0 -1
- package/dist/src/SipConnector.d.ts +0 -301
- package/dist/{src/SipConnectorFacade → SipConnectorFacade}/index.d.ts +0 -0
- package/dist/{src/__fixtures__ → __fixtures__}/RTCPeerConnectionMock.d.ts +1 -1
- /package/dist/{src/__fixtures__ → __fixtures__}/RTCRtpSenderMock.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/Registrator.mock.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/Request.mock.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/WebSocketInterface.mock.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/accountNotify.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/channels.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/channelsNotify.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/conferenceParticipantTokenIssuedNotify.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/delayPromise.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/enterRoom.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/mediaState.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/participantMoveRequests.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/participantNotify.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/remoteCallerData.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/utils.d.ts +0 -0
- /package/dist/{src/__fixtures__ → __fixtures__}/webcastNotify.d.ts +0 -0
- /package/dist/{src/causes.d.ts → causes.d.ts} +0 -0
- /package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/{src/eventNames.d.ts → eventNames.d.ts} +0 -0
- /package/dist/{src/getExtraHeadersRemoteAddress.d.ts → getExtraHeadersRemoteAddress.d.ts} +0 -0
- /package/dist/{src/headers.d.ts → headers.d.ts} +0 -0
- /package/dist/{src/logger.d.ts → logger.d.ts} +0 -0
- /package/dist/{src/setParametersToSender → setParametersToSender}/configureDegradationPreference.d.ts +0 -0
- /package/dist/{src/setParametersToSender → setParametersToSender}/configureEmptyEncodings.d.ts +0 -0
- /package/dist/{src/setParametersToSender → setParametersToSender}/configureEncodings.d.ts +0 -0
- /package/dist/{src/setParametersToSender → setParametersToSender}/configureMaxBitrate.d.ts +0 -0
- /package/dist/{src/setParametersToSender → setParametersToSender}/configureScaleResolutionDownBy.d.ts +0 -0
- /package/dist/{src/setParametersToSender → setParametersToSender}/hasChangedRTCRtpSendParameters.d.ts +0 -0
- /package/dist/{src/setParametersToSender → setParametersToSender}/index.d.ts +0 -0
- /package/dist/{src/setParametersToSender → setParametersToSender}/resolveHasNeedToUpdateItemEncoding.d.ts +0 -0
- /package/dist/{src/setParametersToSender → setParametersToSender}/setParametersToSender.d.ts +0 -0
- /package/dist/{src/tools → tools}/__fixtures__/call.d.ts +0 -0
- /package/dist/{src/tools → tools}/__fixtures__/hasValidUri.d.ts +0 -0
- /package/dist/{src/tools → tools}/__fixtures__/permissions.d.ts +0 -0
- /package/dist/{src/tools → tools}/__fixtures__/processRequest.d.ts +0 -0
- /package/dist/{src/tools → tools}/__tests-utils__/parseObject.d.ts +0 -0
- /package/dist/{src/tools → tools}/__tests-utils__/resolveParseArray.d.ts +0 -0
- /package/dist/{src/tools → tools}/error/getLinkError.d.ts +0 -0
- /package/dist/{src/tools → tools}/error/getTypeFromError.d.ts +0 -0
- /package/dist/{src/tools → tools}/error/getValuesFromError.d.ts +0 -0
- /package/dist/{src/tools → tools}/error/index.d.ts +0 -0
- /package/dist/{src/tools → tools}/error/stringifyMessage.d.ts +0 -0
- /package/dist/{src/tools → tools}/generateSimulcastEncodings.d.ts +0 -0
- /package/dist/{src/tools → tools}/getExtraHeaders.d.ts +0 -0
- /package/dist/{src/tools → tools}/getUserAgent.d.ts +0 -0
- /package/dist/{src/tools → tools}/hasPurgatory.d.ts +0 -0
- /package/dist/{src/tools → tools}/prepareMediaStream.d.ts +0 -0
- /package/dist/{src/tools → tools}/resolveUpdateTransceiver.d.ts +0 -0
- /package/dist/{src/tools → tools}/setVideoTrackContentHints.d.ts +0 -0
- /package/dist/{src/tools → tools}/syncMediaState/index.d.ts +0 -0
- /package/dist/{src/tools → tools}/syncMediaState/resolveOnStartMainCam.d.ts +0 -0
- /package/dist/{src/tools → tools}/syncMediaState/resolveOnStartMic.d.ts +0 -0
- /package/dist/{src/tools → tools}/syncMediaState/resolveOnStopMainCam.d.ts +0 -0
- /package/dist/{src/tools → tools}/syncMediaState/resolveOnStopMic.d.ts +0 -0
- /package/dist/{src/types.d.ts → types.d.ts} +0 -0
- /package/dist/{src/utils → utils}/errors.d.ts +0 -0
- /package/dist/{src/utils → utils}/findSenderByStream.d.ts +0 -0
- /package/dist/{src/utils → utils}/findVideoSender.d.ts +0 -0
- /package/dist/{src/utils → utils}/findVideoTrack.d.ts +0 -0
- /package/dist/{src/utils → utils}/getCodecFromSender.d.ts +0 -0
- /package/dist/{src/utils → utils}/replaceForbiddenSymbolsWithUnderscore.d.ts +0 -0
- /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/balance.d.ts +0 -0
- /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/getMaxBitrateByWidth.d.ts +0 -0
- /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/getMaxBitrateByWidthAndCodec.d.ts +0 -0
- /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/hasAv1Codec.d.ts +0 -0
- /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/hasIncludesString.d.ts +0 -0
- /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/index.d.ts +0 -0
- /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/processSender.d.ts +0 -0
- /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/scaleBitrate.d.ts +0 -0
- /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/scaleBitrateByCodec.d.ts +0 -0
- /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/scaleResolutionAndBitrate.d.ts +0 -0
- /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/setEncodingsToSender.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,228 +1,293 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import {
|
|
3
|
-
import { sequentPromises as
|
|
4
|
-
import { createStackPromises as
|
|
5
|
-
import
|
|
6
|
-
import { default as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { B as G, N as K, l as i, E as F, O as ue } from "./SipConnector-CK3GgjXE.js";
|
|
2
|
+
import { S as Bn, c as Pn, a as xn, d as Un, b as Fn, e as kn, h as Vn } from "./SipConnector-CK3GgjXE.js";
|
|
3
|
+
import { sequentPromises as le } from "sequent-promises";
|
|
4
|
+
import { createStackPromises as de } from "stack-promises";
|
|
5
|
+
import B from "debug";
|
|
6
|
+
import { default as Hn } from "debug";
|
|
7
|
+
import "events-constructor";
|
|
8
|
+
import { isCanceledError as q } from "@krivega/cancelable-promise";
|
|
9
|
+
import { hasCanceledError as fe } from "repeated-calls";
|
|
10
|
+
import { debounce as Ce } from "ts-debounce";
|
|
11
|
+
const ge = (e, n) => (e.degradationPreference = n.degradationPreference, e), Se = (e, n) => {
|
|
12
|
+
e.encodings ??= [];
|
|
13
|
+
for (let t = e.encodings.length; t < n; t += 1)
|
|
14
|
+
e.encodings.push({});
|
|
15
|
+
return e;
|
|
16
|
+
}, z = (e) => (n, t) => t !== void 0 && n !== t || t === void 0 && n !== e, he = z(), me = (e, n) => {
|
|
17
|
+
if (he(e, n))
|
|
18
|
+
return e;
|
|
19
|
+
}, Re = (e, n) => {
|
|
20
|
+
const t = e.maxBitrate, o = me(n, t);
|
|
21
|
+
return o !== void 0 && (e.maxBitrate = o), e;
|
|
22
|
+
}, Q = 1, pe = z(
|
|
23
|
+
Q
|
|
24
|
+
), ye = (e, n) => {
|
|
25
|
+
const t = e === void 0 ? void 0 : Math.max(e, Q);
|
|
26
|
+
if (t !== void 0 && pe(
|
|
27
|
+
t,
|
|
28
|
+
n
|
|
29
|
+
))
|
|
30
|
+
return t;
|
|
31
|
+
}, Ae = (e, n) => {
|
|
32
|
+
const t = e.scaleResolutionDownBy, o = ye(
|
|
33
|
+
n,
|
|
34
|
+
t
|
|
35
|
+
);
|
|
36
|
+
return o !== void 0 && (e.scaleResolutionDownBy = o), e;
|
|
37
|
+
}, Te = (e, n) => {
|
|
38
|
+
const t = n.encodings?.length ?? 0;
|
|
39
|
+
return Se(e, t), e.encodings.forEach((o, r) => {
|
|
40
|
+
const s = (n?.encodings ?? [])[r], c = s?.maxBitrate, a = s?.scaleResolutionDownBy;
|
|
41
|
+
Re(o, c), Ae(o, a);
|
|
42
|
+
}), e;
|
|
43
|
+
}, Me = (e, n) => {
|
|
44
|
+
if (e.codecs?.length !== n.codecs?.length)
|
|
45
|
+
return !0;
|
|
46
|
+
for (let t = 0; t < (e.codecs?.length ?? 0); t++)
|
|
47
|
+
if (JSON.stringify(e.codecs[t]) !== JSON.stringify(n.codecs[t]))
|
|
48
|
+
return !0;
|
|
49
|
+
if (e.headerExtensions?.length !== n.headerExtensions?.length)
|
|
50
|
+
return !0;
|
|
51
|
+
for (let t = 0; t < (e.headerExtensions?.length ?? 0); t++)
|
|
52
|
+
if (JSON.stringify(e.headerExtensions[t]) !== JSON.stringify(n.headerExtensions[t]))
|
|
53
|
+
return !0;
|
|
54
|
+
if (e.encodings?.length !== n.encodings?.length)
|
|
55
|
+
return !0;
|
|
56
|
+
for (let t = 0; t < (e.encodings.length ?? 0); t++)
|
|
57
|
+
if (JSON.stringify(e.encodings[t]) !== JSON.stringify(n.encodings[t]))
|
|
58
|
+
return !0;
|
|
59
|
+
return e.rtcp?.cname !== n.rtcp?.cname || e.rtcp?.reducedSize !== n.rtcp?.reducedSize || e.degradationPreference !== n.degradationPreference;
|
|
60
|
+
}, Z = async (e, n) => {
|
|
61
|
+
const t = e.getParameters(), o = JSON.parse(
|
|
62
|
+
JSON.stringify(t)
|
|
63
|
+
);
|
|
64
|
+
Te(t, n), ge(t, n);
|
|
65
|
+
const r = Me(o, t);
|
|
66
|
+
return r && await e.setParameters(t), { parameters: t, isChanged: r };
|
|
67
|
+
}, V = (e) => {
|
|
68
|
+
const { url: n, cause: t } = e;
|
|
69
|
+
let o = n;
|
|
70
|
+
return (t === G || t === K) && (o = `${e.message.to.uri.user}@${e.message.to.uri.host}`), o;
|
|
14
71
|
};
|
|
15
|
-
var
|
|
16
|
-
const
|
|
17
|
-
const { cause:
|
|
18
|
-
let
|
|
19
|
-
switch (
|
|
72
|
+
var ee = /* @__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))(ee || {});
|
|
73
|
+
const Ee = new Error("Unknown error"), Ne = (e = Ee) => {
|
|
74
|
+
const { cause: n, socket: t } = e;
|
|
75
|
+
let o = "CONNECT_SERVER_FAILED";
|
|
76
|
+
switch (n) {
|
|
20
77
|
case "Forbidden": {
|
|
21
|
-
|
|
78
|
+
o = "WRONG_USER_OR_PASSWORD";
|
|
22
79
|
break;
|
|
23
80
|
}
|
|
24
|
-
case
|
|
25
|
-
|
|
81
|
+
case G: {
|
|
82
|
+
o = "BAD_MEDIA_ERROR";
|
|
26
83
|
break;
|
|
27
84
|
}
|
|
28
|
-
case
|
|
29
|
-
|
|
85
|
+
case K: {
|
|
86
|
+
o = "NOT_FOUND_ERROR";
|
|
30
87
|
break;
|
|
31
88
|
}
|
|
32
89
|
default:
|
|
33
|
-
t && t
|
|
90
|
+
t !== void 0 && t._ws?.readyState === 3 ? o = "WS_CONNECTION_FAILED" : V(e) !== void 0 && V(e) !== "" && (o = "CONNECT_SERVER_FAILED_BY_LINK");
|
|
34
91
|
}
|
|
35
|
-
return
|
|
36
|
-
},
|
|
37
|
-
let
|
|
92
|
+
return o;
|
|
93
|
+
}, _e = (e) => {
|
|
94
|
+
let n = "";
|
|
38
95
|
try {
|
|
39
|
-
|
|
96
|
+
n = JSON.stringify(e);
|
|
40
97
|
} catch (t) {
|
|
41
98
|
i("failed to stringify message", t);
|
|
42
99
|
}
|
|
43
|
-
return
|
|
44
|
-
},
|
|
45
|
-
const { code:
|
|
46
|
-
return typeof
|
|
47
|
-
},
|
|
100
|
+
return n;
|
|
101
|
+
}, ve = new Error("Unknown error"), Oe = (e = ve) => {
|
|
102
|
+
const { code: n, cause: t, message: o } = e, r = V(e), s = { code: "", cause: "", message: "" };
|
|
103
|
+
return typeof o == "object" && o !== null ? s.message = _e(o) : o && (s.message = String(o)), r !== void 0 && r !== "" && (s.link = r), n !== void 0 && n !== "" && (s.code = n), t !== void 0 && t !== "" && (s.cause = t), s;
|
|
104
|
+
}, be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
48
105
|
__proto__: null,
|
|
49
|
-
EErrorTypes:
|
|
50
|
-
getLinkError:
|
|
51
|
-
getTypeFromError:
|
|
52
|
-
getValuesFromError:
|
|
53
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
54
|
-
sessionId:
|
|
55
|
-
remoteAddress:
|
|
106
|
+
EErrorTypes: ee,
|
|
107
|
+
getLinkError: V,
|
|
108
|
+
getTypeFromError: Ne,
|
|
109
|
+
getValuesFromError: Oe
|
|
110
|
+
}, Symbol.toStringTag, { value: "Module" })), Ie = ({
|
|
111
|
+
sessionId: e,
|
|
112
|
+
remoteAddress: n,
|
|
56
113
|
isMutedAudio: t,
|
|
57
|
-
isMutedVideo:
|
|
58
|
-
isRegistered:
|
|
59
|
-
isPresentationCall:
|
|
114
|
+
isMutedVideo: o,
|
|
115
|
+
isRegistered: r,
|
|
116
|
+
isPresentationCall: s
|
|
60
117
|
}) => {
|
|
61
|
-
const c = [], a = t ? "0" : "1", u =
|
|
62
|
-
return c.push(`X-Vinteo-Mic-State: ${a}`, `X-Vinteo-MainCam-State: ${u}`),
|
|
63
|
-
},
|
|
64
|
-
let
|
|
65
|
-
return
|
|
66
|
-
},
|
|
67
|
-
appName:
|
|
68
|
-
appVersion:
|
|
118
|
+
const c = [], a = t ? "0" : "1", u = o ? "0" : "1";
|
|
119
|
+
return c.push(`X-Vinteo-Mic-State: ${a}`, `X-Vinteo-MainCam-State: ${u}`), (r === !1 || r === void 0) && c.push("X-Vinteo-Purgatory-Call: yes"), e !== void 0 && e !== "" && c.push(`X-Vinteo-Session: ${e}`), s === !0 && c.push("X-Vinteo-Presentation-Call: yes"), n !== void 0 && n !== "" && c.push(`X-Vinteo-Remote: ${n}`), c;
|
|
120
|
+
}, De = "[@*!|]", we = "_", Be = (e) => {
|
|
121
|
+
let n = e;
|
|
122
|
+
return n = n.replaceAll(new RegExp(De, "g"), we), n;
|
|
123
|
+
}, Pe = ({
|
|
124
|
+
appName: e,
|
|
125
|
+
appVersion: n,
|
|
69
126
|
browserName: t,
|
|
70
|
-
browserVersion:
|
|
127
|
+
browserVersion: o
|
|
71
128
|
}) => {
|
|
72
|
-
const
|
|
73
|
-
return `ChromeNew - ${t ? `${t} ${
|
|
74
|
-
},
|
|
75
|
-
isUnifiedSdpSemantic:
|
|
76
|
-
appVersion:
|
|
129
|
+
const s = `${Be(e)} ${n}`;
|
|
130
|
+
return `ChromeNew - ${t === void 0 ? s : `${t} ${o}, ${s}`}`;
|
|
131
|
+
}, xe = ({
|
|
132
|
+
isUnifiedSdpSemantic: e,
|
|
133
|
+
appVersion: n,
|
|
77
134
|
browserName: t,
|
|
78
|
-
browserVersion:
|
|
79
|
-
appName:
|
|
80
|
-
}) =>
|
|
81
|
-
accumulatedKeys:
|
|
82
|
-
sendKey:
|
|
135
|
+
browserVersion: o,
|
|
136
|
+
appName: r
|
|
137
|
+
}) => e ? Pe({ appVersion: n, browserName: t, browserVersion: o, appName: r }) : "Chrome", ne = "purgatory", P = (e) => e === ne, Ue = (e) => (n) => [...n].map((o) => async () => e(o)), Fe = async ({
|
|
138
|
+
accumulatedKeys: e,
|
|
139
|
+
sendKey: n,
|
|
83
140
|
canRunTask: t
|
|
84
141
|
}) => {
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
-
},
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
|
|
142
|
+
const r = Ue(n)(e);
|
|
143
|
+
return le(r, t);
|
|
144
|
+
}, ke = (e) => (t) => (i("onStartMainCam"), e.onApi("admin-start-main-cam", t)), Ve = (e) => (t) => (i("onStartMic"), e.onApi("admin-start-mic", t)), Le = (e) => (t) => (i("onStopMainCam"), e.onApi("admin-stop-main-cam", t)), He = (e) => (t) => (i("onStopMic"), e.onApi("admin-stop-mic", t)), $e = ({ sipConnector: e }) => {
|
|
145
|
+
const n = (g, R) => ({ isSyncForced: S }) => {
|
|
146
|
+
if (S === !0) {
|
|
147
|
+
g();
|
|
91
148
|
return;
|
|
92
149
|
}
|
|
93
150
|
R();
|
|
94
|
-
}, t =
|
|
95
|
-
let c
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, l = () => {
|
|
99
|
-
};
|
|
100
|
-
const S = ({
|
|
101
|
-
onStartMainCamForced: f,
|
|
151
|
+
}, t = ke(e), o = Le(e), r = Ve(e), s = He(e);
|
|
152
|
+
let c, a, u, d;
|
|
153
|
+
const C = ({
|
|
154
|
+
onStartMainCamForced: g,
|
|
102
155
|
onStartMainCamNotForced: R,
|
|
103
|
-
onStopMainCamForced:
|
|
156
|
+
onStopMainCamForced: S,
|
|
104
157
|
onStopMainCamNotForced: h,
|
|
105
|
-
onStartMicForced:
|
|
158
|
+
onStartMicForced: p,
|
|
106
159
|
onStartMicNotForced: y,
|
|
107
|
-
onStopMicForced:
|
|
108
|
-
onStopMicNotForced:
|
|
160
|
+
onStopMicForced: A,
|
|
161
|
+
onStopMicNotForced: T
|
|
109
162
|
}) => {
|
|
110
|
-
const
|
|
111
|
-
|
|
163
|
+
const N = n(
|
|
164
|
+
g,
|
|
112
165
|
R
|
|
113
166
|
);
|
|
114
|
-
c = t(
|
|
115
|
-
const
|
|
116
|
-
|
|
167
|
+
c = t(N);
|
|
168
|
+
const v = n(
|
|
169
|
+
S,
|
|
117
170
|
h
|
|
118
171
|
);
|
|
119
|
-
a =
|
|
120
|
-
const
|
|
121
|
-
u =
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
c(), a(), u(),
|
|
172
|
+
a = o(v);
|
|
173
|
+
const O = n(p, y);
|
|
174
|
+
u = r(O);
|
|
175
|
+
const b = n(A, T);
|
|
176
|
+
d = s(b);
|
|
177
|
+
}, f = () => {
|
|
178
|
+
c?.(), a?.(), u?.(), d?.();
|
|
126
179
|
};
|
|
127
180
|
return {
|
|
128
|
-
start: (
|
|
129
|
-
|
|
181
|
+
start: (g) => {
|
|
182
|
+
C(g);
|
|
130
183
|
},
|
|
131
184
|
stop: () => {
|
|
132
|
-
|
|
185
|
+
f();
|
|
133
186
|
}
|
|
134
187
|
};
|
|
135
|
-
},
|
|
188
|
+
}, vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
136
189
|
__proto__: null,
|
|
137
|
-
PURGATORY_CONFERENCE_NUMBER:
|
|
138
|
-
createSyncMediaState:
|
|
139
|
-
error:
|
|
140
|
-
getExtraHeaders:
|
|
141
|
-
getUserAgent:
|
|
142
|
-
hasPurgatory:
|
|
143
|
-
|
|
144
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
190
|
+
PURGATORY_CONFERENCE_NUMBER: ne,
|
|
191
|
+
createSyncMediaState: $e,
|
|
192
|
+
error: be,
|
|
193
|
+
getExtraHeaders: Ie,
|
|
194
|
+
getUserAgent: xe,
|
|
195
|
+
hasPurgatory: P,
|
|
196
|
+
sendDtmfAccumulated: Fe
|
|
197
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
198
|
+
var _ = /* @__PURE__ */ ((e) => (e.PAUSE_MAIN_CAM = "PAUSEMAINCAM", e.RESUME_MAIN_CAM = "RESUMEMAINCAM", e.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", e.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", e.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", e))(_ || {}), Xe = /* @__PURE__ */ ((e) => (e.ADMIN_STOP_MIC = "ADMINSTOPMIC", e.ADMIN_START_MIC = "ADMINSTARTMIC", e))(Xe || {}), Je = /* @__PURE__ */ ((e) => (e.ADMIN_SYNC_FORCED = "1", e.ADMIN_SYNC_NOT_FORCED = "0", e))(Je || {}), We = /* @__PURE__ */ ((e) => (e.AUDIO = "AUDIO", e.VIDEO = "VIDEO", e.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", e))(We || {}), Ye = /* @__PURE__ */ ((e) => (e.VP8 = "video/VP8", e.VP9 = "video/VP9", e.H264 = "video/H264", e.AV1 = "video/AV1", e.rtx = "video/rtx", e.red = "video/red", e.flexfec03 = "video/flexfec-03", e))(Ye || {});
|
|
199
|
+
const je = (e) => [...e.keys()].map((n) => e.get(n)), Ge = (e, n) => je(e).find((t) => t?.type === n), Ke = async (e) => e.getStats().then((n) => Ge(n, "codec")?.mimeType), qe = (e) => e.find((n) => n.track?.kind === "video"), te = (e, n) => e !== void 0 && n !== void 0 && e.toLowerCase().includes(n.toLowerCase()), ze = 1e6, m = (e) => e * ze, oe = m(0.06), Qe = m(4), Ze = (e) => e <= 64 ? oe : e <= 128 ? m(0.12) : e <= 256 ? m(0.25) : e <= 384 ? m(0.32) : e <= 426 ? m(0.38) : e <= 640 ? m(0.5) : e <= 848 ? m(0.7) : e <= 1280 ? m(1) : e <= 1920 ? m(2) : Qe, en = "av1", nn = (e) => te(e, en), tn = 0.6, re = (e, n) => nn(n) ? e * tn : e, on = (e) => re(oe, e), se = (e, n) => {
|
|
200
|
+
const t = Ze(e);
|
|
201
|
+
return re(t, n);
|
|
202
|
+
}, X = 1, ce = ({
|
|
203
|
+
videoTrack: e,
|
|
204
|
+
targetSize: n,
|
|
150
205
|
codec: t
|
|
151
206
|
}) => {
|
|
152
|
-
const
|
|
153
|
-
return { scaleResolutionDownBy: u, maxBitrate:
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
207
|
+
const o = e.getSettings(), r = o.width, s = o.height, c = r === void 0 ? X : r / n.width, a = s === void 0 ? X : s / n.height, u = Math.max(c, a, X), d = se(n.width, t);
|
|
208
|
+
return { scaleResolutionDownBy: u, maxBitrate: d };
|
|
209
|
+
}, rn = async (e, n, t) => {
|
|
210
|
+
const { isChanged: o, parameters: r } = await Z(e, {
|
|
211
|
+
encodings: [
|
|
212
|
+
{
|
|
213
|
+
scaleResolutionDownBy: n.scaleResolutionDownBy,
|
|
214
|
+
maxBitrate: n.maxBitrate
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
});
|
|
218
|
+
return o && t && t(r), { isChanged: o, parameters: r };
|
|
219
|
+
}, ie = de(), sn = async () => ie().catch((e) => {
|
|
220
|
+
i("videoSendingBalancer: error", e);
|
|
221
|
+
}), cn = async (e) => (ie.add(e), sn()), W = async ({
|
|
222
|
+
sender: e,
|
|
223
|
+
scaleResolutionDownBy: n,
|
|
159
224
|
maxBitrate: t,
|
|
160
|
-
onSetParameters:
|
|
161
|
-
}) =>
|
|
162
|
-
const
|
|
163
|
-
return
|
|
164
|
-
sender:
|
|
165
|
-
maxBitrate:
|
|
225
|
+
onSetParameters: o
|
|
226
|
+
}) => cn(async () => rn(e, { scaleResolutionDownBy: n, maxBitrate: t }, o)), an = async ({ sender: e, codec: n }, t) => {
|
|
227
|
+
const r = on(n);
|
|
228
|
+
return W({
|
|
229
|
+
sender: e,
|
|
230
|
+
maxBitrate: r,
|
|
166
231
|
onSetParameters: t,
|
|
167
232
|
scaleResolutionDownBy: 200
|
|
168
233
|
});
|
|
169
234
|
}, k = async ({
|
|
170
|
-
sender:
|
|
171
|
-
videoTrack:
|
|
235
|
+
sender: e,
|
|
236
|
+
videoTrack: n,
|
|
172
237
|
codec: t
|
|
173
|
-
},
|
|
174
|
-
const c =
|
|
175
|
-
return
|
|
176
|
-
sender:
|
|
238
|
+
}, o) => {
|
|
239
|
+
const c = n.getSettings().width, a = se(c ?? 0, t);
|
|
240
|
+
return W({
|
|
241
|
+
sender: e,
|
|
177
242
|
maxBitrate: a,
|
|
178
|
-
onSetParameters:
|
|
243
|
+
onSetParameters: o,
|
|
179
244
|
scaleResolutionDownBy: 1
|
|
180
245
|
});
|
|
181
|
-
},
|
|
182
|
-
sender:
|
|
183
|
-
videoTrack:
|
|
246
|
+
}, un = async ({
|
|
247
|
+
sender: e,
|
|
248
|
+
videoTrack: n,
|
|
184
249
|
resolution: t,
|
|
185
|
-
codec:
|
|
186
|
-
},
|
|
187
|
-
const [
|
|
188
|
-
videoTrack:
|
|
189
|
-
codec:
|
|
250
|
+
codec: o
|
|
251
|
+
}, r) => {
|
|
252
|
+
const [s, c] = t.split("x"), { maxBitrate: a, scaleResolutionDownBy: u } = ce({
|
|
253
|
+
videoTrack: n,
|
|
254
|
+
codec: o,
|
|
190
255
|
targetSize: {
|
|
191
|
-
width: Number(
|
|
256
|
+
width: Number(s),
|
|
192
257
|
height: Number(c)
|
|
193
258
|
}
|
|
194
259
|
});
|
|
195
|
-
return
|
|
196
|
-
sender:
|
|
260
|
+
return W({
|
|
261
|
+
sender: e,
|
|
197
262
|
maxBitrate: a,
|
|
198
|
-
onSetParameters:
|
|
263
|
+
onSetParameters: r,
|
|
199
264
|
scaleResolutionDownBy: u
|
|
200
265
|
});
|
|
201
|
-
},
|
|
202
|
-
mainCam:
|
|
203
|
-
resolutionMainCam:
|
|
266
|
+
}, ln = async ({
|
|
267
|
+
mainCam: e,
|
|
268
|
+
resolutionMainCam: n,
|
|
204
269
|
sender: t,
|
|
205
|
-
videoTrack:
|
|
206
|
-
codec:
|
|
207
|
-
},
|
|
208
|
-
switch (
|
|
209
|
-
case
|
|
210
|
-
return
|
|
211
|
-
case
|
|
212
|
-
return k({ sender: t, videoTrack:
|
|
213
|
-
case
|
|
214
|
-
return
|
|
215
|
-
{ sender: t, videoTrack:
|
|
216
|
-
|
|
217
|
-
) : k({ sender: t, videoTrack:
|
|
218
|
-
case
|
|
219
|
-
case
|
|
270
|
+
videoTrack: o,
|
|
271
|
+
codec: r
|
|
272
|
+
}, s) => {
|
|
273
|
+
switch (e) {
|
|
274
|
+
case _.PAUSE_MAIN_CAM:
|
|
275
|
+
return an({ sender: t, codec: r }, s);
|
|
276
|
+
case _.RESUME_MAIN_CAM:
|
|
277
|
+
return k({ sender: t, videoTrack: o, codec: r }, s);
|
|
278
|
+
case _.MAX_MAIN_CAM_RESOLUTION:
|
|
279
|
+
return n !== void 0 ? un(
|
|
280
|
+
{ sender: t, videoTrack: o, codec: r, resolution: n },
|
|
281
|
+
s
|
|
282
|
+
) : k({ sender: t, videoTrack: o, codec: r }, s);
|
|
283
|
+
case _.ADMIN_STOP_MAIN_CAM:
|
|
284
|
+
case _.ADMIN_START_MAIN_CAM:
|
|
220
285
|
case void 0:
|
|
221
|
-
return k({ sender: t, videoTrack:
|
|
286
|
+
return k({ sender: t, videoTrack: o, codec: r }, s);
|
|
222
287
|
default:
|
|
223
|
-
return k({ sender: t, videoTrack:
|
|
288
|
+
return k({ sender: t, videoTrack: o, codec: r }, s);
|
|
224
289
|
}
|
|
225
|
-
},
|
|
290
|
+
}, Y = {
|
|
226
291
|
isChanged: !1,
|
|
227
292
|
parameters: {
|
|
228
293
|
encodings: [{}],
|
|
@@ -232,125 +297,139 @@ const Ce = (n = new Error()) => {
|
|
|
232
297
|
rtcp: {}
|
|
233
298
|
}
|
|
234
299
|
}, j = async ({
|
|
235
|
-
mainCam:
|
|
236
|
-
resolutionMainCam:
|
|
300
|
+
mainCam: e,
|
|
301
|
+
resolutionMainCam: n,
|
|
237
302
|
connection: t,
|
|
238
|
-
onSetParameters:
|
|
239
|
-
ignoreForCodec:
|
|
303
|
+
onSetParameters: o,
|
|
304
|
+
ignoreForCodec: r
|
|
240
305
|
}) => {
|
|
241
|
-
const
|
|
306
|
+
const s = t.getSenders(), c = qe(s);
|
|
242
307
|
if (!c?.track)
|
|
243
|
-
return
|
|
244
|
-
const a = await
|
|
245
|
-
return
|
|
308
|
+
return Y;
|
|
309
|
+
const a = await Ke(c);
|
|
310
|
+
return te(a, r) ? Y : ln(
|
|
246
311
|
{
|
|
247
|
-
mainCam:
|
|
248
|
-
resolutionMainCam:
|
|
312
|
+
mainCam: e,
|
|
313
|
+
resolutionMainCam: n,
|
|
249
314
|
sender: c,
|
|
250
315
|
codec: a,
|
|
251
316
|
videoTrack: c.track
|
|
252
317
|
},
|
|
253
|
-
|
|
318
|
+
o
|
|
254
319
|
);
|
|
255
|
-
},
|
|
256
|
-
ignoreForCodec:
|
|
320
|
+
}, On = (e, {
|
|
321
|
+
ignoreForCodec: n,
|
|
257
322
|
onSetParameters: t
|
|
258
323
|
} = {}) => {
|
|
259
|
-
const
|
|
260
|
-
const { connection: u } =
|
|
324
|
+
const o = async () => {
|
|
325
|
+
const { connection: u } = e;
|
|
261
326
|
if (!u)
|
|
262
327
|
throw new Error("connection is not exist");
|
|
263
328
|
return j({
|
|
264
329
|
connection: u,
|
|
265
330
|
onSetParameters: t,
|
|
266
|
-
ignoreForCodec:
|
|
331
|
+
ignoreForCodec: n
|
|
267
332
|
});
|
|
268
333
|
};
|
|
269
|
-
let
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
const { mainCam:
|
|
273
|
-
if (!
|
|
334
|
+
let r = o;
|
|
335
|
+
const s = (u) => {
|
|
336
|
+
r = async () => {
|
|
337
|
+
const { mainCam: d, resolutionMainCam: C } = u, { connection: f } = e;
|
|
338
|
+
if (!f)
|
|
274
339
|
throw new Error("connection is not exist");
|
|
275
340
|
return j({
|
|
276
|
-
mainCam:
|
|
277
|
-
resolutionMainCam:
|
|
278
|
-
connection:
|
|
341
|
+
mainCam: d,
|
|
342
|
+
resolutionMainCam: C,
|
|
343
|
+
connection: f,
|
|
279
344
|
onSetParameters: t,
|
|
280
|
-
ignoreForCodec:
|
|
345
|
+
ignoreForCodec: n
|
|
281
346
|
});
|
|
282
|
-
},
|
|
347
|
+
}, r().catch(B);
|
|
283
348
|
};
|
|
284
349
|
return {
|
|
285
350
|
subscribe: () => {
|
|
286
|
-
|
|
351
|
+
e.onApi("main-cam-control", s);
|
|
287
352
|
},
|
|
288
353
|
unsubscribe: () => {
|
|
289
|
-
|
|
354
|
+
e.offApi("main-cam-control", s);
|
|
290
355
|
},
|
|
291
|
-
balanceByTrack:
|
|
356
|
+
balanceByTrack: o,
|
|
292
357
|
resetMainCamControl() {
|
|
293
|
-
|
|
358
|
+
r = o;
|
|
294
359
|
},
|
|
295
360
|
async reBalance() {
|
|
296
|
-
return
|
|
361
|
+
return r();
|
|
297
362
|
}
|
|
298
363
|
};
|
|
299
|
-
},
|
|
300
|
-
|
|
301
|
-
|
|
364
|
+
}, dn = (e) => e instanceof Object && ("originator" in e || "cause" in e), bn = (e) => {
|
|
365
|
+
if (q(e))
|
|
366
|
+
return !0;
|
|
367
|
+
if (!dn(e))
|
|
368
|
+
return !1;
|
|
369
|
+
const { originator: n, cause: t } = e;
|
|
370
|
+
return typeof t == "string" ? t === F.REQUEST_TIMEOUT || t === F.REJECTED || n === ue.LOCAL && (t === F.CANCELED || t === F.BYE) : !1;
|
|
371
|
+
}, fn = (e) => e.getVideoTracks()[0], D = ({
|
|
372
|
+
mediaStream: e,
|
|
373
|
+
simulcastEncodings: n,
|
|
302
374
|
sendEncodings: t
|
|
303
375
|
}) => {
|
|
304
|
-
if (
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
const
|
|
310
|
-
|
|
376
|
+
if (n && n.length > 0) {
|
|
377
|
+
const o = t ?? [], r = fn(e);
|
|
378
|
+
if (r === void 0)
|
|
379
|
+
throw new Error("No video track");
|
|
380
|
+
return n.forEach((s, c) => {
|
|
381
|
+
const a = o[c] ?? {};
|
|
382
|
+
a.active = !0, s.rid !== void 0 && (a.rid = s.rid), s.scalabilityMode !== void 0 && (a.scalabilityMode = s.scalabilityMode);
|
|
383
|
+
const { maxBitrate: u, scaleResolutionDownBy: d } = ce({
|
|
384
|
+
videoTrack: r,
|
|
311
385
|
targetSize: {
|
|
312
|
-
width:
|
|
313
|
-
height:
|
|
386
|
+
width: s.width,
|
|
387
|
+
height: s.height
|
|
314
388
|
}
|
|
315
389
|
});
|
|
316
|
-
a.maxBitrate = u, a.scaleResolutionDownBy =
|
|
317
|
-
}),
|
|
390
|
+
a.maxBitrate = u, a.scaleResolutionDownBy = d, o[c] = a;
|
|
391
|
+
}), o;
|
|
318
392
|
}
|
|
319
393
|
return t;
|
|
320
|
-
},
|
|
321
|
-
const
|
|
322
|
-
return
|
|
323
|
-
},
|
|
324
|
-
const
|
|
394
|
+
}, Cn = (e, n) => e.filter((o) => n.some((r) => r.clockRate === o.clockRate && r.mimeType === o.mimeType && r.channels === o.channels && r.sdpFmtpLine === o.sdpFmtpLine)), gn = (e) => {
|
|
395
|
+
const n = RTCRtpSender.getCapabilities(e), t = RTCRtpReceiver.getCapabilities(e), o = n === null ? [] : n.codecs, r = t === null ? [] : t.codecs;
|
|
396
|
+
return Cn(o, r);
|
|
397
|
+
}, Sn = (e, n) => n === void 0 || n.length === 0 ? e : e.sort((t, o) => {
|
|
398
|
+
const r = n.indexOf(t.mimeType), s = n.indexOf(o.mimeType), c = r === -1 ? Number.MAX_VALUE : r, a = s === -1 ? Number.MAX_VALUE : s;
|
|
325
399
|
return c - a;
|
|
326
|
-
}),
|
|
327
|
-
preferredMimeTypesVideoCodecs:
|
|
400
|
+
}), hn = (e, n) => n === void 0 || n.length === 0 ? e : e.filter((t) => !n.includes(t.mimeType)), w = (e, {
|
|
401
|
+
preferredMimeTypesVideoCodecs: n,
|
|
328
402
|
excludeMimeTypesVideoCodecs: t
|
|
329
|
-
}) => async (
|
|
403
|
+
}) => async (o) => {
|
|
330
404
|
try {
|
|
331
|
-
if (typeof
|
|
332
|
-
const
|
|
333
|
-
|
|
405
|
+
if (typeof o.setCodecPreferences == "function" && o.sender.track?.kind === "video" && (n !== void 0 && n.length > 0 || t !== void 0 && t.length > 0)) {
|
|
406
|
+
const r = gn("video"), s = hn(r, t), c = Sn(s, n);
|
|
407
|
+
o.setCodecPreferences(c);
|
|
334
408
|
}
|
|
335
|
-
Object.keys(
|
|
336
|
-
} catch (
|
|
337
|
-
i("updateTransceiver error",
|
|
409
|
+
Object.keys(e).length > 0 && await Z(o.sender, e);
|
|
410
|
+
} catch (r) {
|
|
411
|
+
i("updateTransceiver error", r);
|
|
338
412
|
}
|
|
339
|
-
},
|
|
340
|
-
if (!
|
|
341
|
-
throw
|
|
413
|
+
}, J = (e) => {
|
|
414
|
+
if (!q(e) && !fe(e))
|
|
415
|
+
throw e;
|
|
342
416
|
return { isSuccessful: !1 };
|
|
343
|
-
},
|
|
417
|
+
}, mn = ({ kind: e, readyState: n }) => e === "video" && n === "live", Rn = /* @__PURE__ */ new Set([
|
|
344
418
|
"on",
|
|
345
419
|
"once",
|
|
346
420
|
"onceRace",
|
|
347
421
|
"wait",
|
|
348
422
|
"off",
|
|
349
|
-
"
|
|
350
|
-
"
|
|
351
|
-
"
|
|
352
|
-
"
|
|
353
|
-
"
|
|
423
|
+
"onCall",
|
|
424
|
+
"onceCall",
|
|
425
|
+
"onceRaceCall",
|
|
426
|
+
"waitCall",
|
|
427
|
+
"offCall",
|
|
428
|
+
"onIncomingCall",
|
|
429
|
+
"onceIncomingCall",
|
|
430
|
+
"onceRaceIncomingCall",
|
|
431
|
+
"waitIncomingCall",
|
|
432
|
+
"offIncomingCall",
|
|
354
433
|
"sendDTMF",
|
|
355
434
|
"hangUp",
|
|
356
435
|
"declineToIncomingCall",
|
|
@@ -362,10 +441,7 @@ const Ce = (n = new Error()) => {
|
|
|
362
441
|
"isConfigured",
|
|
363
442
|
"isRegistered"
|
|
364
443
|
]);
|
|
365
|
-
class
|
|
366
|
-
sipConnector;
|
|
367
|
-
preferredMimeTypesVideoCodecs;
|
|
368
|
-
excludeMimeTypesVideoCodecs;
|
|
444
|
+
class In {
|
|
369
445
|
// @ts-expect-error: proxy method
|
|
370
446
|
on;
|
|
371
447
|
// @ts-expect-error: proxy method
|
|
@@ -377,15 +453,25 @@ class un {
|
|
|
377
453
|
// @ts-expect-error: proxy method
|
|
378
454
|
off;
|
|
379
455
|
// @ts-expect-error: proxy method
|
|
380
|
-
|
|
456
|
+
onCall;
|
|
457
|
+
// @ts-expect-error: proxy method
|
|
458
|
+
onceCall;
|
|
381
459
|
// @ts-expect-error: proxy method
|
|
382
|
-
|
|
460
|
+
onceRaceCall;
|
|
383
461
|
// @ts-expect-error: proxy method
|
|
384
|
-
|
|
462
|
+
waitCall;
|
|
385
463
|
// @ts-expect-error: proxy method
|
|
386
|
-
|
|
464
|
+
offCall;
|
|
387
465
|
// @ts-expect-error: proxy method
|
|
388
|
-
|
|
466
|
+
onIncomingCall;
|
|
467
|
+
// @ts-expect-error: proxy method
|
|
468
|
+
onceIncomingCall;
|
|
469
|
+
// @ts-expect-error: proxy method
|
|
470
|
+
onceRaceIncomingCall;
|
|
471
|
+
// @ts-expect-error: proxy method
|
|
472
|
+
waitIncomingCall;
|
|
473
|
+
// @ts-expect-error: proxy method
|
|
474
|
+
offIncomingCall;
|
|
389
475
|
// @ts-expect-error: proxy method
|
|
390
476
|
sendDTMF;
|
|
391
477
|
// @ts-expect-error: proxy method
|
|
@@ -406,71 +492,76 @@ class un {
|
|
|
406
492
|
isConfigured;
|
|
407
493
|
// @ts-expect-error: proxy method
|
|
408
494
|
isRegistered;
|
|
409
|
-
|
|
495
|
+
sipConnector;
|
|
496
|
+
preferredMimeTypesVideoCodecs;
|
|
497
|
+
excludeMimeTypesVideoCodecs;
|
|
498
|
+
constructor(n, {
|
|
410
499
|
preferredMimeTypesVideoCodecs: t,
|
|
411
|
-
excludeMimeTypesVideoCodecs:
|
|
500
|
+
excludeMimeTypesVideoCodecs: o
|
|
412
501
|
} = {}) {
|
|
413
|
-
return this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs =
|
|
414
|
-
get: (
|
|
415
|
-
if (typeof
|
|
416
|
-
const u = Reflect.get(this.sipConnector,
|
|
502
|
+
return this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = o, this.sipConnector = n, new Proxy(this, {
|
|
503
|
+
get: (r, s, c) => {
|
|
504
|
+
if (typeof s == "string" && Rn.has(s) && s in this.sipConnector) {
|
|
505
|
+
const u = Reflect.get(this.sipConnector, s, this.sipConnector);
|
|
417
506
|
return typeof u == "function" ? u.bind(this.sipConnector) : u;
|
|
418
507
|
}
|
|
419
|
-
const a = Reflect.get(
|
|
420
|
-
return typeof a == "function" ? a.bind(
|
|
508
|
+
const a = Reflect.get(r, s, c);
|
|
509
|
+
return typeof a == "function" ? a.bind(r) : a;
|
|
421
510
|
}
|
|
422
511
|
});
|
|
423
512
|
}
|
|
424
|
-
connectToServer = async (
|
|
513
|
+
connectToServer = async (n) => {
|
|
425
514
|
const {
|
|
426
515
|
userAgent: t,
|
|
427
|
-
sipWebSocketServerURL:
|
|
428
|
-
sipServerUrl:
|
|
429
|
-
remoteAddress:
|
|
516
|
+
sipWebSocketServerURL: o,
|
|
517
|
+
sipServerUrl: r,
|
|
518
|
+
remoteAddress: s,
|
|
430
519
|
displayName: c,
|
|
431
520
|
name: a,
|
|
432
521
|
password: u,
|
|
433
|
-
isRegisteredUser:
|
|
434
|
-
isDisconnectOnFail:
|
|
435
|
-
} =
|
|
436
|
-
return i("connectToServer",
|
|
522
|
+
isRegisteredUser: d,
|
|
523
|
+
isDisconnectOnFail: C
|
|
524
|
+
} = n;
|
|
525
|
+
return i("connectToServer", n), this.sipConnector.connect({
|
|
437
526
|
userAgent: t,
|
|
438
|
-
sipWebSocketServerURL:
|
|
439
|
-
sipServerUrl:
|
|
440
|
-
remoteAddress:
|
|
527
|
+
sipWebSocketServerURL: o,
|
|
528
|
+
sipServerUrl: r,
|
|
529
|
+
remoteAddress: s,
|
|
441
530
|
displayName: c,
|
|
442
531
|
password: u,
|
|
443
532
|
user: a,
|
|
444
|
-
register:
|
|
445
|
-
}).then((
|
|
533
|
+
register: d
|
|
534
|
+
}).then((f) => (i("connectToServer then"), { ua: f, isSuccessful: !0 })).catch(async (f) => (i("connectToServer catch: error", f), C === !0 ? this.sipConnector.disconnect().then(() => J(f)).catch(() => J(f)) : J(f)));
|
|
446
535
|
};
|
|
447
|
-
callToServer = async (
|
|
536
|
+
callToServer = async (n) => {
|
|
448
537
|
const {
|
|
449
538
|
conference: t,
|
|
450
|
-
mediaStream:
|
|
451
|
-
extraHeaders:
|
|
452
|
-
iceServers:
|
|
539
|
+
mediaStream: o,
|
|
540
|
+
extraHeaders: r,
|
|
541
|
+
iceServers: s,
|
|
453
542
|
contentHint: c,
|
|
454
543
|
simulcastEncodings: a,
|
|
455
544
|
degradationPreference: u,
|
|
456
|
-
sendEncodings:
|
|
457
|
-
offerToReceiveAudio:
|
|
458
|
-
offerToReceiveVideo:
|
|
459
|
-
directionVideo:
|
|
460
|
-
directionAudio:
|
|
461
|
-
setRemoteStreams:
|
|
545
|
+
sendEncodings: d,
|
|
546
|
+
offerToReceiveAudio: C,
|
|
547
|
+
offerToReceiveVideo: f,
|
|
548
|
+
directionVideo: x,
|
|
549
|
+
directionAudio: U,
|
|
550
|
+
setRemoteStreams: g,
|
|
462
551
|
onBeforeProgressCall: R,
|
|
463
|
-
onSuccessProgressCall:
|
|
552
|
+
onSuccessProgressCall: S,
|
|
464
553
|
onEnterPurgatory: h,
|
|
465
|
-
onEnterConference:
|
|
554
|
+
onEnterConference: p,
|
|
466
555
|
onFailProgressCall: y,
|
|
467
|
-
onFinishProgressCall:
|
|
468
|
-
onEndedCall:
|
|
469
|
-
} =
|
|
470
|
-
onReadyRemoteStreams:
|
|
471
|
-
}),
|
|
472
|
-
onReadyRemoteStreams:
|
|
473
|
-
|
|
556
|
+
onFinishProgressCall: A,
|
|
557
|
+
onEndedCall: T
|
|
558
|
+
} = n, N = this.resolveHandleReadyRemoteStreamsDebounced({
|
|
559
|
+
onReadyRemoteStreams: g
|
|
560
|
+
}), v = this.resolveHandleReadyRemoteStreams({
|
|
561
|
+
onReadyRemoteStreams: () => {
|
|
562
|
+
N().catch(B);
|
|
563
|
+
}
|
|
564
|
+
}), O = w(
|
|
474
565
|
{
|
|
475
566
|
degradationPreference: u
|
|
476
567
|
},
|
|
@@ -479,65 +570,67 @@ class un {
|
|
|
479
570
|
excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
|
|
480
571
|
}
|
|
481
572
|
);
|
|
482
|
-
i("callToServer",
|
|
483
|
-
const
|
|
484
|
-
mediaStream:
|
|
485
|
-
extraHeaders:
|
|
486
|
-
iceServers:
|
|
573
|
+
i("callToServer", n);
|
|
574
|
+
const b = async () => (i("startCall"), this.sipConnector.call({
|
|
575
|
+
mediaStream: o,
|
|
576
|
+
extraHeaders: r,
|
|
577
|
+
iceServers: s,
|
|
487
578
|
contentHint: c,
|
|
488
|
-
offerToReceiveAudio:
|
|
489
|
-
offerToReceiveVideo:
|
|
490
|
-
directionVideo:
|
|
491
|
-
directionAudio:
|
|
492
|
-
sendEncodings:
|
|
493
|
-
mediaStream:
|
|
579
|
+
offerToReceiveAudio: C,
|
|
580
|
+
offerToReceiveVideo: f,
|
|
581
|
+
directionVideo: x,
|
|
582
|
+
directionAudio: U,
|
|
583
|
+
sendEncodings: D({
|
|
584
|
+
mediaStream: o,
|
|
494
585
|
simulcastEncodings: a,
|
|
495
|
-
sendEncodings:
|
|
586
|
+
sendEncodings: d
|
|
496
587
|
}),
|
|
497
588
|
number: t,
|
|
498
|
-
onAddedTransceiver:
|
|
499
|
-
ontrack:
|
|
589
|
+
onAddedTransceiver: O,
|
|
590
|
+
ontrack: v
|
|
500
591
|
}));
|
|
501
|
-
let M = !1,
|
|
502
|
-
const
|
|
503
|
-
i("enterRoom", { _room:
|
|
592
|
+
let M = !1, E;
|
|
593
|
+
const I = (i("subscribeEnterConference: onEnterConference", p), h ?? p ? this.sipConnector.onApi("enterRoom", ({ room: l }) => {
|
|
594
|
+
i("enterRoom", { _room: l, isSuccessProgressCall: M }), E = l, P(E) ? h && h() : p && p({ isSuccessProgressCall: M });
|
|
504
595
|
}) : () => {
|
|
505
|
-
}),
|
|
506
|
-
|
|
507
|
-
}),
|
|
508
|
-
throw i("onFail"), y && y(),
|
|
509
|
-
},
|
|
510
|
-
i("onFinish"),
|
|
596
|
+
}), L = (l) => (i("onSuccess"), M = !0, N().catch(B), S && S({ isPurgatory: P(E) }), this.sipConnector.onceRaceCall(["ended", "failed"], () => {
|
|
597
|
+
I(), T && T();
|
|
598
|
+
}), l), H = (l) => {
|
|
599
|
+
throw i("onFail"), y && y(), I(), l;
|
|
600
|
+
}, $ = () => {
|
|
601
|
+
i("onFinish"), A && A();
|
|
511
602
|
};
|
|
512
|
-
return i("onBeforeProgressCall"), R && R(t),
|
|
603
|
+
return i("onBeforeProgressCall"), R && R(t), b().then(L).catch((l) => H(l)).finally($);
|
|
513
604
|
};
|
|
514
|
-
disconnectFromServer = async () => this.sipConnector.disconnect().then(() => (i("disconnectFromServer: then"), { isSuccessful: !0 })).catch((
|
|
515
|
-
|
|
605
|
+
disconnectFromServer = async () => this.sipConnector.disconnect().then(() => (i("disconnectFromServer: then"), { isSuccessful: !0 })).catch((n) => (i("disconnectFromServer: catch", n), { isSuccessful: !1 }));
|
|
606
|
+
answerToIncomingCall = async (n) => {
|
|
516
607
|
const {
|
|
517
608
|
mediaStream: t,
|
|
518
|
-
extraHeaders:
|
|
519
|
-
iceServers:
|
|
520
|
-
contentHint:
|
|
609
|
+
extraHeaders: o,
|
|
610
|
+
iceServers: r,
|
|
611
|
+
contentHint: s,
|
|
521
612
|
simulcastEncodings: c,
|
|
522
613
|
degradationPreference: a,
|
|
523
614
|
sendEncodings: u,
|
|
524
|
-
offerToReceiveAudio:
|
|
525
|
-
offerToReceiveVideo:
|
|
526
|
-
directionVideo:
|
|
527
|
-
directionAudio:
|
|
528
|
-
setRemoteStreams:
|
|
529
|
-
onBeforeProgressCall:
|
|
615
|
+
offerToReceiveAudio: d,
|
|
616
|
+
offerToReceiveVideo: C,
|
|
617
|
+
directionVideo: f,
|
|
618
|
+
directionAudio: x,
|
|
619
|
+
setRemoteStreams: U,
|
|
620
|
+
onBeforeProgressCall: g,
|
|
530
621
|
onSuccessProgressCall: R,
|
|
531
|
-
onEnterPurgatory:
|
|
622
|
+
onEnterPurgatory: S,
|
|
532
623
|
onEnterConference: h,
|
|
533
|
-
onFailProgressCall:
|
|
624
|
+
onFailProgressCall: p,
|
|
534
625
|
onFinishProgressCall: y,
|
|
535
|
-
onEndedCall:
|
|
536
|
-
} =
|
|
537
|
-
onReadyRemoteStreams:
|
|
538
|
-
}),
|
|
539
|
-
onReadyRemoteStreams:
|
|
540
|
-
|
|
626
|
+
onEndedCall: A
|
|
627
|
+
} = n, T = this.resolveHandleReadyRemoteStreamsDebounced({
|
|
628
|
+
onReadyRemoteStreams: U
|
|
629
|
+
}), N = this.resolveHandleReadyRemoteStreams({
|
|
630
|
+
onReadyRemoteStreams: () => {
|
|
631
|
+
T().catch(B);
|
|
632
|
+
}
|
|
633
|
+
}), v = w(
|
|
541
634
|
{
|
|
542
635
|
degradationPreference: a
|
|
543
636
|
},
|
|
@@ -546,143 +639,141 @@ class un {
|
|
|
546
639
|
excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
|
|
547
640
|
}
|
|
548
641
|
);
|
|
549
|
-
i("
|
|
550
|
-
const
|
|
642
|
+
i("answerToIncomingCall", n);
|
|
643
|
+
const O = async () => this.sipConnector.answerToIncomingCall({
|
|
551
644
|
mediaStream: t,
|
|
552
|
-
extraHeaders:
|
|
553
|
-
iceServers:
|
|
554
|
-
contentHint:
|
|
555
|
-
offerToReceiveAudio:
|
|
556
|
-
offerToReceiveVideo:
|
|
557
|
-
directionVideo:
|
|
558
|
-
directionAudio:
|
|
559
|
-
sendEncodings:
|
|
645
|
+
extraHeaders: o,
|
|
646
|
+
iceServers: r,
|
|
647
|
+
contentHint: s,
|
|
648
|
+
offerToReceiveAudio: d,
|
|
649
|
+
offerToReceiveVideo: C,
|
|
650
|
+
directionVideo: f,
|
|
651
|
+
directionAudio: x,
|
|
652
|
+
sendEncodings: D({
|
|
560
653
|
mediaStream: t,
|
|
561
654
|
simulcastEncodings: c,
|
|
562
655
|
sendEncodings: u
|
|
563
656
|
}),
|
|
564
|
-
onAddedTransceiver:
|
|
565
|
-
ontrack:
|
|
566
|
-
}),
|
|
567
|
-
const { remoteCallerData:
|
|
568
|
-
return
|
|
657
|
+
onAddedTransceiver: v,
|
|
658
|
+
ontrack: N
|
|
659
|
+
}), b = () => {
|
|
660
|
+
const { remoteCallerData: l } = this.sipConnector;
|
|
661
|
+
return l.incomingNumber;
|
|
569
662
|
};
|
|
570
|
-
let M = !1,
|
|
571
|
-
const
|
|
572
|
-
i("enterRoom", { _room:
|
|
663
|
+
let M = !1, E;
|
|
664
|
+
const I = (i("subscribeEnterConference: onEnterConference", h), S ?? h ? this.sipConnector.onApi("enterRoom", (l) => {
|
|
665
|
+
i("enterRoom", { _room: l, isSuccessProgressCall: M }), E = l, P(E) ? S && S() : h && h({ isSuccessProgressCall: M });
|
|
573
666
|
}) : () => {
|
|
574
|
-
}),
|
|
575
|
-
|
|
576
|
-
}),
|
|
577
|
-
throw i("onFail"),
|
|
578
|
-
},
|
|
667
|
+
}), L = (l) => (i("onSuccess"), M = !0, T().catch(B), R && R({ isPurgatory: P(E) }), this.sipConnector.onceRaceCall(["ended", "failed"], () => {
|
|
668
|
+
I(), A && A();
|
|
669
|
+
}), l), H = (l) => {
|
|
670
|
+
throw i("onFail"), p && p(), I(), l;
|
|
671
|
+
}, $ = () => {
|
|
579
672
|
i("onFinish"), y && y();
|
|
580
673
|
};
|
|
581
|
-
if (i("onBeforeProgressCall"),
|
|
582
|
-
const
|
|
583
|
-
|
|
674
|
+
if (i("onBeforeProgressCall"), g) {
|
|
675
|
+
const l = b();
|
|
676
|
+
g(l);
|
|
584
677
|
}
|
|
585
|
-
return
|
|
678
|
+
return O().then(L).catch((l) => H(l)).finally($);
|
|
586
679
|
};
|
|
587
680
|
updatePresentation = async ({
|
|
588
|
-
mediaStream:
|
|
681
|
+
mediaStream: n,
|
|
589
682
|
isP2P: t,
|
|
590
|
-
maxBitrate:
|
|
591
|
-
contentHint:
|
|
592
|
-
simulcastEncodings:
|
|
683
|
+
maxBitrate: o,
|
|
684
|
+
contentHint: r,
|
|
685
|
+
simulcastEncodings: s,
|
|
593
686
|
degradationPreference: c,
|
|
594
687
|
sendEncodings: a,
|
|
595
688
|
preferredMimeTypesVideoCodecs: u,
|
|
596
|
-
excludeMimeTypesVideoCodecs:
|
|
689
|
+
excludeMimeTypesVideoCodecs: d
|
|
597
690
|
}) => {
|
|
598
|
-
const
|
|
691
|
+
const C = w(
|
|
599
692
|
{
|
|
600
693
|
degradationPreference: c
|
|
601
694
|
},
|
|
602
695
|
{
|
|
603
696
|
preferredMimeTypesVideoCodecs: u,
|
|
604
|
-
excludeMimeTypesVideoCodecs:
|
|
697
|
+
excludeMimeTypesVideoCodecs: d
|
|
605
698
|
}
|
|
606
699
|
);
|
|
607
|
-
return i("updatePresentation"), this.sipConnector.updatePresentation(
|
|
700
|
+
return i("updatePresentation"), this.sipConnector.updatePresentation(n, {
|
|
608
701
|
isP2P: t,
|
|
609
|
-
maxBitrate:
|
|
610
|
-
contentHint:
|
|
611
|
-
sendEncodings:
|
|
612
|
-
mediaStream:
|
|
613
|
-
simulcastEncodings:
|
|
702
|
+
maxBitrate: o,
|
|
703
|
+
contentHint: r,
|
|
704
|
+
sendEncodings: D({
|
|
705
|
+
mediaStream: n,
|
|
706
|
+
simulcastEncodings: s,
|
|
614
707
|
sendEncodings: a
|
|
615
708
|
}),
|
|
616
|
-
onAddedTransceiver:
|
|
709
|
+
onAddedTransceiver: C
|
|
617
710
|
});
|
|
618
711
|
};
|
|
619
712
|
startPresentation = async ({
|
|
620
|
-
mediaStream:
|
|
713
|
+
mediaStream: n,
|
|
621
714
|
isP2P: t,
|
|
622
|
-
maxBitrate:
|
|
623
|
-
contentHint:
|
|
624
|
-
simulcastEncodings:
|
|
715
|
+
maxBitrate: o,
|
|
716
|
+
contentHint: r,
|
|
717
|
+
simulcastEncodings: s,
|
|
625
718
|
degradationPreference: c,
|
|
626
719
|
sendEncodings: a,
|
|
627
720
|
preferredMimeTypesVideoCodecs: u,
|
|
628
|
-
excludeMimeTypesVideoCodecs:
|
|
629
|
-
|
|
630
|
-
|
|
721
|
+
excludeMimeTypesVideoCodecs: d,
|
|
722
|
+
callLimit: C
|
|
723
|
+
}) => {
|
|
724
|
+
const f = w(
|
|
631
725
|
{
|
|
632
726
|
degradationPreference: c
|
|
633
727
|
},
|
|
634
728
|
{
|
|
635
729
|
preferredMimeTypesVideoCodecs: u,
|
|
636
|
-
excludeMimeTypesVideoCodecs:
|
|
730
|
+
excludeMimeTypesVideoCodecs: d
|
|
637
731
|
}
|
|
638
732
|
);
|
|
639
|
-
return i("startPresentation"), this.sipConnector.startPresentation(
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
},
|
|
652
|
-
S
|
|
653
|
-
);
|
|
733
|
+
return i("startPresentation"), this.sipConnector.startPresentation(n, {
|
|
734
|
+
isP2P: t,
|
|
735
|
+
maxBitrate: o,
|
|
736
|
+
contentHint: r,
|
|
737
|
+
callLimit: C,
|
|
738
|
+
sendEncodings: D({
|
|
739
|
+
mediaStream: n,
|
|
740
|
+
simulcastEncodings: s,
|
|
741
|
+
sendEncodings: a
|
|
742
|
+
}),
|
|
743
|
+
onAddedTransceiver: f
|
|
744
|
+
});
|
|
654
745
|
};
|
|
655
|
-
stopShareSipConnector = async ({ isP2P:
|
|
656
|
-
isP2P:
|
|
746
|
+
stopShareSipConnector = async ({ isP2P: n = !1 } = {}) => (i("stopShareSipConnector"), this.sipConnector.stopPresentation({
|
|
747
|
+
isP2P: n
|
|
657
748
|
}).catch((t) => {
|
|
658
749
|
i(t);
|
|
659
750
|
}));
|
|
660
751
|
sendRefusalToTurnOnMic = async () => {
|
|
661
|
-
|
|
662
|
-
i("sendRefusalToTurnOnMic: error",
|
|
663
|
-
})
|
|
752
|
+
i("sendRefusalToTurnOnMic"), await this.sipConnector.sendRefusalToTurnOnMic().catch((n) => {
|
|
753
|
+
i("sendRefusalToTurnOnMic: error", n);
|
|
754
|
+
});
|
|
664
755
|
};
|
|
665
756
|
sendRefusalToTurnOnCam = async () => {
|
|
666
|
-
|
|
667
|
-
i("sendRefusalToTurnOnCam: error",
|
|
668
|
-
})
|
|
757
|
+
i("sendRefusalToTurnOnCam"), await this.sipConnector.sendRefusalToTurnOnCam().catch((n) => {
|
|
758
|
+
i("sendRefusalToTurnOnCam: error", n);
|
|
759
|
+
});
|
|
669
760
|
};
|
|
670
761
|
sendMediaState = async ({
|
|
671
|
-
isEnabledCam:
|
|
762
|
+
isEnabledCam: n,
|
|
672
763
|
isEnabledMic: t
|
|
673
764
|
}) => {
|
|
674
|
-
|
|
765
|
+
i("sendMediaState"), await this.sipConnector.sendMediaState({ cam: n, mic: t });
|
|
675
766
|
};
|
|
676
|
-
replaceMediaStream = async (
|
|
767
|
+
replaceMediaStream = async (n, {
|
|
677
768
|
deleteExisting: t,
|
|
678
|
-
addMissing:
|
|
679
|
-
forceRenegotiation:
|
|
680
|
-
contentHint:
|
|
769
|
+
addMissing: o,
|
|
770
|
+
forceRenegotiation: r,
|
|
771
|
+
contentHint: s,
|
|
681
772
|
simulcastEncodings: c,
|
|
682
773
|
degradationPreference: a,
|
|
683
774
|
sendEncodings: u
|
|
684
775
|
} = {}) => {
|
|
685
|
-
const
|
|
776
|
+
const d = w(
|
|
686
777
|
{
|
|
687
778
|
degradationPreference: a
|
|
688
779
|
},
|
|
@@ -691,56 +782,58 @@ class un {
|
|
|
691
782
|
excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
|
|
692
783
|
}
|
|
693
784
|
);
|
|
694
|
-
return i("replaceMediaStream"), this.sipConnector.replaceMediaStream(
|
|
785
|
+
return i("replaceMediaStream"), this.sipConnector.replaceMediaStream(n, {
|
|
695
786
|
deleteExisting: t,
|
|
696
|
-
addMissing:
|
|
697
|
-
forceRenegotiation:
|
|
698
|
-
contentHint:
|
|
699
|
-
sendEncodings:
|
|
700
|
-
mediaStream:
|
|
787
|
+
addMissing: o,
|
|
788
|
+
forceRenegotiation: r,
|
|
789
|
+
contentHint: s,
|
|
790
|
+
sendEncodings: D({
|
|
791
|
+
mediaStream: n,
|
|
701
792
|
simulcastEncodings: c,
|
|
702
793
|
sendEncodings: u
|
|
703
794
|
}),
|
|
704
|
-
onAddedTransceiver:
|
|
795
|
+
onAddedTransceiver: d
|
|
705
796
|
});
|
|
706
797
|
};
|
|
707
798
|
askPermissionToEnableCam = async () => {
|
|
708
|
-
|
|
799
|
+
i("askPermissionToEnableCam"), await this.sipConnector.askPermissionToEnableCam();
|
|
709
800
|
};
|
|
710
801
|
resolveHandleReadyRemoteStreamsDebounced = ({
|
|
711
|
-
onReadyRemoteStreams:
|
|
712
|
-
}) =>
|
|
802
|
+
onReadyRemoteStreams: n
|
|
803
|
+
}) => Ce(() => {
|
|
713
804
|
const t = this.sipConnector.getRemoteStreams();
|
|
714
|
-
i("remoteStreams", t), t &&
|
|
805
|
+
i("remoteStreams", t), t && n(t);
|
|
715
806
|
}, 200);
|
|
807
|
+
// eslint-disable-next-line class-methods-use-this
|
|
716
808
|
resolveHandleReadyRemoteStreams = ({
|
|
717
|
-
onReadyRemoteStreams:
|
|
809
|
+
onReadyRemoteStreams: n
|
|
718
810
|
}) => ({ track: t }) => {
|
|
719
|
-
|
|
811
|
+
mn(t) && n();
|
|
720
812
|
};
|
|
721
813
|
getRemoteStreams = () => (i("getRemoteStreams"), this.sipConnector.getRemoteStreams());
|
|
722
|
-
onUseLicense = (
|
|
723
|
-
onMustStopPresentation = (
|
|
724
|
-
onMoveToSpectators = (
|
|
725
|
-
onMoveToParticipants = (
|
|
814
|
+
onUseLicense = (n) => (i("onUseLicense"), this.sipConnector.onApi("useLicense", n));
|
|
815
|
+
onMustStopPresentation = (n) => (i("onMustStopPresentation"), this.sipConnector.onApi("mustStopPresentation", n));
|
|
816
|
+
onMoveToSpectators = (n) => (i("onMoveToSpectators"), this.sipConnector.onApi("participant:move-request-to-spectators", n));
|
|
817
|
+
onMoveToParticipants = (n) => (i("onMoveToParticipants"), this.sipConnector.onApi("participant:move-request-to-participants", n));
|
|
726
818
|
}
|
|
727
819
|
export {
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
820
|
+
_ as EEventsMainCAM,
|
|
821
|
+
Xe as EEventsMic,
|
|
822
|
+
Je as EEventsSyncMediaState,
|
|
823
|
+
Ye as EMimeTypesVideoCodecs,
|
|
824
|
+
We as EUseLicense,
|
|
825
|
+
Bn as SipConnector,
|
|
826
|
+
In as SipConnectorFacade,
|
|
827
|
+
Pn as causes,
|
|
828
|
+
xn as constants,
|
|
829
|
+
Hn as debug,
|
|
830
|
+
Un as disableDebug,
|
|
831
|
+
Fn as enableDebug,
|
|
832
|
+
kn as eventNames,
|
|
833
|
+
Ke as getCodecFromSender,
|
|
834
|
+
bn as hasCanceledCallError,
|
|
835
|
+
Vn as hasCanceledStartPresentationError,
|
|
836
|
+
On as resolveVideoSendingBalancer,
|
|
837
|
+
Z as setParametersToSender,
|
|
838
|
+
vn as tools
|
|
746
839
|
};
|