sip-connector 6.19.0 → 6.20.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/SipConnector.d.ts +1 -5
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1040 -1432
- package/dist/tools/__tests-utils__/parseObject.d.ts +3 -1
- package/dist/tools/__tests-utils__/resolveParseArray.d.ts +1 -1
- package/dist/tools/resolveUpdateRemoteStreams.d.ts +4 -1
- package/dist/types.d.ts +5 -0
- package/package.json +5 -6
package/dist/index.js
CHANGED
|
@@ -1,733 +1,805 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CancelableRequest as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { default as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
1
|
+
var xt = Object.defineProperty;
|
|
2
|
+
var Yt = (n, e, t) => e in n ? xt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var a = (n, e, t) => (Yt(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { CancelableRequest as O, isCanceledError as et } from "@krivega/cancelable-promise";
|
|
5
|
+
import Ye from "events-constructor";
|
|
6
|
+
import ne from "debug";
|
|
7
|
+
import { default as mr } from "debug";
|
|
8
|
+
import { debounce as Gt } from "ts-debounce";
|
|
9
|
+
import Xt from "sequent-promises";
|
|
10
|
+
import zt from "stack-promises";
|
|
11
|
+
const Kt = "Connection Error", tt = "Request Timeout", Jt = "SIP Failure Code", Qt = "Internal Error", jt = "Busy", nt = "Rejected", Zt = "Redirected", en = "Unavailable", se = "Not Found", tn = "Address Incomplete", nn = "Incompatible SDP", sn = "Missing SDP", rn = "Authentication Error", st = "Terminated", on = "WebRTC Error", rt = "Canceled", an = "No Answer", cn = "Expires", un = "No ACK", En = "Dialog Error", _n = "User Denied Media Access", re = "Bad Media Description", ln = "RTP Timeout", ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11
12
|
__proto__: null,
|
|
12
|
-
ADDRESS_INCOMPLETE:
|
|
13
|
-
AUTHENTICATION_ERROR:
|
|
14
|
-
BAD_MEDIA_DESCRIPTION:
|
|
15
|
-
BUSY:
|
|
16
|
-
BYE:
|
|
17
|
-
CANCELED:
|
|
18
|
-
CONNECTION_ERROR:
|
|
19
|
-
DIALOG_ERROR:
|
|
20
|
-
EXPIRES:
|
|
21
|
-
INCOMPATIBLE_SDP:
|
|
22
|
-
INTERNAL_ERROR:
|
|
23
|
-
MISSING_SDP:
|
|
24
|
-
NOT_FOUND:
|
|
25
|
-
NO_ACK:
|
|
26
|
-
NO_ANSWER:
|
|
27
|
-
REDIRECTED:
|
|
28
|
-
REJECTED:
|
|
29
|
-
REQUEST_TIMEOUT:
|
|
30
|
-
RTP_TIMEOUT:
|
|
31
|
-
SIP_FAILURE_CODE:
|
|
32
|
-
UNAVAILABLE:
|
|
33
|
-
USER_DENIED_MEDIA_ACCESS:
|
|
34
|
-
WEBRTC_ERROR:
|
|
35
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
36
|
-
|
|
13
|
+
ADDRESS_INCOMPLETE: tn,
|
|
14
|
+
AUTHENTICATION_ERROR: rn,
|
|
15
|
+
BAD_MEDIA_DESCRIPTION: re,
|
|
16
|
+
BUSY: jt,
|
|
17
|
+
BYE: st,
|
|
18
|
+
CANCELED: rt,
|
|
19
|
+
CONNECTION_ERROR: Kt,
|
|
20
|
+
DIALOG_ERROR: En,
|
|
21
|
+
EXPIRES: cn,
|
|
22
|
+
INCOMPATIBLE_SDP: nn,
|
|
23
|
+
INTERNAL_ERROR: Qt,
|
|
24
|
+
MISSING_SDP: sn,
|
|
25
|
+
NOT_FOUND: se,
|
|
26
|
+
NO_ACK: un,
|
|
27
|
+
NO_ANSWER: an,
|
|
28
|
+
REDIRECTED: Zt,
|
|
29
|
+
REJECTED: nt,
|
|
30
|
+
REQUEST_TIMEOUT: tt,
|
|
31
|
+
RTP_TIMEOUT: ln,
|
|
32
|
+
SIP_FAILURE_CODE: Jt,
|
|
33
|
+
UNAVAILABLE: en,
|
|
34
|
+
USER_DENIED_MEDIA_ACCESS: _n,
|
|
35
|
+
WEBRTC_ERROR: on
|
|
36
|
+
}, Symbol.toStringTag, { value: "Module" })), oe = "incomingCall", ie = "declinedIncomingCall", ae = "failedIncomingCall", ce = "terminatedIncomingCall", z = "connecting", V = "connected", D = "disconnected", W = "newRTCSession", L = "registered", ue = "unregistered", B = "registrationFailed", ot = "newMessage", Ee = "sipEvent", _e = "availableSecondRemoteStream", le = "notAvailableSecondRemoteStream", de = "mustStopPresentation", q = "shareState", Se = "enterRoom", he = "useLicense", Te = "peerconnection:confirmed", Ce = "peerconnection:ontrack", $ = "channels", ge = "channels:notify", Ne = "ended:fromserver", me = "main-cam-control", Re = "admin-stop-main-cam", Ae = "admin-start-main-cam", fe = "admin-stop-mic", Ie = "admin-start-mic", x = "admin-force-sync-media-state", Me = "participant:added-to-list-moderators", Oe = "participant:removed-from-list-moderators", Pe = "participant:move-request-to-conference", De = "participant:move-request-to-stream", pe = "participant:canceling-word-request", ve = "webcast:started", ye = "webcast:stopped", be = "account:changed", we = "account:deleted", Ue = "conference:participant-token-issued", F = "ended", it = "sending", at = "reinvite", ct = "replaces", ut = "refer", Et = "progress", _t = "accepted", Y = "confirmed", G = "peerconnection", y = "failed", lt = "muted", dt = "unmuted", Le = "newDTMF", Be = "newInfo", St = "hold", ht = "unhold", Tt = "update", Ct = "sdp", gt = "icecandidate", Nt = "getusermediafailed", mt = "peerconnection:createofferfailed", Rt = "peerconnection:createanswerfailed", At = "peerconnection:setlocaldescriptionfailed", ft = "peerconnection:setremotedescriptionfailed", It = "presentation:start", Mt = "presentation:started", Ot = "presentation:end", Fe = "presentation:ended", X = "presentation:failed", Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
37
|
+
__proto__: null,
|
|
38
|
+
ACCEPTED: _t,
|
|
39
|
+
ACCOUNT_CHANGED: be,
|
|
40
|
+
ACCOUNT_DELETED: we,
|
|
41
|
+
ADMIN_FORCE_SYNC_MEDIA_STATE: x,
|
|
42
|
+
ADMIN_START_MAIN_CAM: Ae,
|
|
43
|
+
ADMIN_START_MIC: Ie,
|
|
44
|
+
ADMIN_STOP_MAIN_CAM: Re,
|
|
45
|
+
ADMIN_STOP_MIC: fe,
|
|
46
|
+
AVAILABLE_SECOND_REMOTE_STREAM_EVENT: _e,
|
|
47
|
+
CHANNELS: $,
|
|
48
|
+
CHANNELS_NOTIFY: ge,
|
|
49
|
+
CONFERENCE_PARTICIPANT_TOKEN_ISSUED: Ue,
|
|
50
|
+
CONFIRMED: Y,
|
|
51
|
+
CONNECTED: V,
|
|
52
|
+
CONNECTING: z,
|
|
53
|
+
DECLINED_INCOMING_CALL: ie,
|
|
54
|
+
DISCONNECTED: D,
|
|
55
|
+
ENDED: F,
|
|
56
|
+
ENDED_FROM_SERVER: Ne,
|
|
57
|
+
ENTER_ROOM: Se,
|
|
58
|
+
FAILED: y,
|
|
59
|
+
FAILED_INCOMING_CALL: ae,
|
|
60
|
+
GET_USER_MEDIA_FAILED: Nt,
|
|
61
|
+
HOLD: St,
|
|
62
|
+
ICE_CANDIDATE: gt,
|
|
63
|
+
INCOMING_CALL: oe,
|
|
64
|
+
MAIN_CAM_CONTROL: me,
|
|
65
|
+
MUST_STOP_PRESENTATION_EVENT: de,
|
|
66
|
+
MUTED: lt,
|
|
67
|
+
NEW_DTMF: Le,
|
|
68
|
+
NEW_INFO: Be,
|
|
69
|
+
NEW_MESSAGE: ot,
|
|
70
|
+
NEW_RTC_SESSION: W,
|
|
71
|
+
NOT_AVAILABLE_SECOND_REMOTE_STREAM_EVENT: le,
|
|
72
|
+
PARTICIPANT_ADDED_TO_LIST_MODERATORS: Me,
|
|
73
|
+
PARTICIPANT_CANCELLING_WORD_REQUEST: pe,
|
|
74
|
+
PARTICIPANT_MOVE_REQUEST_TO_CONFERENCE: Pe,
|
|
75
|
+
PARTICIPANT_MOVE_REQUEST_TO_STREAM: De,
|
|
76
|
+
PARTICIPANT_REMOVED_FROM_LIST_MODERATORS: Oe,
|
|
77
|
+
PEER_CONNECTION: G,
|
|
78
|
+
PEER_CONNECTION_CONFIRMED: Te,
|
|
79
|
+
PEER_CONNECTION_CREATE_ANSWER_FAILED: Rt,
|
|
80
|
+
PEER_CONNECTION_CREATE_OFFER_FAILED: mt,
|
|
81
|
+
PEER_CONNECTION_ONTRACK: Ce,
|
|
82
|
+
PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED: At,
|
|
83
|
+
PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED: ft,
|
|
84
|
+
PRESENTATION_END: Ot,
|
|
85
|
+
PRESENTATION_ENDED: Fe,
|
|
86
|
+
PRESENTATION_FAILED: X,
|
|
87
|
+
PRESENTATION_START: It,
|
|
88
|
+
PRESENTATION_STARTED: Mt,
|
|
89
|
+
PROGRESS: Et,
|
|
90
|
+
REFER: ut,
|
|
91
|
+
REGISTERED: L,
|
|
92
|
+
REGISTRATION_FAILED: B,
|
|
93
|
+
REINVITE: at,
|
|
94
|
+
REPLACES: ct,
|
|
95
|
+
SDP: Ct,
|
|
96
|
+
SENDING: it,
|
|
97
|
+
SHARE_STATE: q,
|
|
98
|
+
SIP_EVENT: Ee,
|
|
99
|
+
TERMINATED_INCOMING_CALL: ce,
|
|
100
|
+
UNHOLD: ht,
|
|
101
|
+
UNMUTED: dt,
|
|
102
|
+
UNREGISTERED: ue,
|
|
103
|
+
UPDATE: Tt,
|
|
104
|
+
USE_LICENSE: he,
|
|
105
|
+
WEBCAST_STARTED: ve,
|
|
106
|
+
WEBCAST_STOPPED: ye
|
|
107
|
+
}, Symbol.toStringTag, { value: "Module" })), Pt = [
|
|
108
|
+
oe,
|
|
109
|
+
ie,
|
|
110
|
+
ce,
|
|
111
|
+
ae,
|
|
112
|
+
pe,
|
|
113
|
+
De,
|
|
114
|
+
Pe,
|
|
115
|
+
ge,
|
|
116
|
+
Ue,
|
|
117
|
+
be,
|
|
118
|
+
we,
|
|
119
|
+
ve,
|
|
120
|
+
ye,
|
|
121
|
+
Me,
|
|
122
|
+
Oe
|
|
123
|
+
], ke = [
|
|
124
|
+
z,
|
|
125
|
+
V,
|
|
126
|
+
D,
|
|
127
|
+
W,
|
|
128
|
+
L,
|
|
129
|
+
ue,
|
|
130
|
+
B,
|
|
131
|
+
ot,
|
|
132
|
+
Ee
|
|
133
|
+
], Dt = [
|
|
134
|
+
_e,
|
|
135
|
+
le,
|
|
136
|
+
de,
|
|
137
|
+
q,
|
|
138
|
+
Se,
|
|
139
|
+
he,
|
|
140
|
+
Te,
|
|
141
|
+
Ce,
|
|
142
|
+
$,
|
|
143
|
+
Ne,
|
|
144
|
+
me,
|
|
145
|
+
Ae,
|
|
146
|
+
Re,
|
|
147
|
+
fe,
|
|
148
|
+
Ie,
|
|
149
|
+
x
|
|
150
|
+
], He = [
|
|
151
|
+
F,
|
|
152
|
+
z,
|
|
153
|
+
it,
|
|
154
|
+
at,
|
|
155
|
+
ct,
|
|
156
|
+
ut,
|
|
157
|
+
Et,
|
|
158
|
+
_t,
|
|
159
|
+
Y,
|
|
160
|
+
G,
|
|
161
|
+
y,
|
|
162
|
+
lt,
|
|
163
|
+
dt,
|
|
164
|
+
Le,
|
|
165
|
+
Be,
|
|
166
|
+
St,
|
|
167
|
+
ht,
|
|
37
168
|
Tt,
|
|
38
169
|
Ct,
|
|
170
|
+
gt,
|
|
171
|
+
Nt,
|
|
39
172
|
mt,
|
|
40
|
-
Ht,
|
|
41
|
-
xt,
|
|
42
|
-
Bt,
|
|
43
|
-
Mt,
|
|
44
|
-
Gt,
|
|
45
|
-
jt,
|
|
46
|
-
qt,
|
|
47
|
-
Wt,
|
|
48
|
-
Vt,
|
|
49
|
-
Ft,
|
|
50
|
-
kt
|
|
51
|
-
], Ne = [
|
|
52
|
-
Re,
|
|
53
|
-
oe,
|
|
54
|
-
w,
|
|
55
|
-
ie,
|
|
56
|
-
H,
|
|
57
173
|
Rt,
|
|
58
|
-
W,
|
|
59
|
-
er,
|
|
60
|
-
Nt
|
|
61
|
-
], Kt = [
|
|
62
|
-
vt,
|
|
63
174
|
At,
|
|
64
|
-
|
|
65
|
-
ae,
|
|
66
|
-
bt,
|
|
67
|
-
yt,
|
|
175
|
+
ft,
|
|
68
176
|
It,
|
|
177
|
+
Mt,
|
|
69
178
|
Ot,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Ut,
|
|
77
|
-
ue
|
|
78
|
-
], ve = [
|
|
79
|
-
V,
|
|
80
|
-
Re,
|
|
81
|
-
tr,
|
|
82
|
-
nr,
|
|
83
|
-
rr,
|
|
84
|
-
sr,
|
|
85
|
-
or,
|
|
86
|
-
ir,
|
|
87
|
-
le,
|
|
88
|
-
_e,
|
|
89
|
-
U,
|
|
90
|
-
ar,
|
|
91
|
-
cr,
|
|
92
|
-
Yt,
|
|
93
|
-
Xt,
|
|
94
|
-
ur,
|
|
95
|
-
lr,
|
|
96
|
-
_r,
|
|
97
|
-
dr,
|
|
98
|
-
Er,
|
|
99
|
-
hr,
|
|
100
|
-
fr,
|
|
101
|
-
Sr,
|
|
102
|
-
gr,
|
|
103
|
-
Tr,
|
|
104
|
-
mr,
|
|
105
|
-
Cr,
|
|
106
|
-
Rr,
|
|
107
|
-
zt,
|
|
108
|
-
de
|
|
109
|
-
], Qt = [...Ne, ...Jt], Zt = [
|
|
110
|
-
...ve,
|
|
111
|
-
...Kt
|
|
112
|
-
], Ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
179
|
+
Fe,
|
|
180
|
+
X
|
|
181
|
+
], pt = [...ke, ...Pt], vt = [
|
|
182
|
+
...He,
|
|
183
|
+
...Dt
|
|
184
|
+
], _r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
113
185
|
__proto__: null,
|
|
114
|
-
SESSION_EVENT_NAMES:
|
|
115
|
-
SESSION_JSSIP_EVENT_NAMES:
|
|
116
|
-
SESSION_SYNTHETICS_EVENT_NAMES:
|
|
117
|
-
UA_EVENT_NAMES:
|
|
118
|
-
UA_JSSIP_EVENT_NAMES:
|
|
119
|
-
UA_SYNTHETICS_EVENT_NAMES:
|
|
120
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
121
|
-
const
|
|
122
|
-
return
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
|
|
186
|
+
SESSION_EVENT_NAMES: vt,
|
|
187
|
+
SESSION_JSSIP_EVENT_NAMES: He,
|
|
188
|
+
SESSION_SYNTHETICS_EVENT_NAMES: Dt,
|
|
189
|
+
UA_EVENT_NAMES: pt,
|
|
190
|
+
UA_JSSIP_EVENT_NAMES: ke,
|
|
191
|
+
UA_SYNTHETICS_EVENT_NAMES: Pt
|
|
192
|
+
}, Symbol.toStringTag, { value: "Module" })), dn = (n) => {
|
|
193
|
+
const e = [];
|
|
194
|
+
return n && e.push(`X-Vinteo-Remote: ${n}`), e;
|
|
195
|
+
}, Sn = "content-type", hn = "x-webrtc-enter-room", K = "application/vinteo.webrtc.sharedesktop", Tn = "application/vinteo.webrtc.roomname", Cn = "application/vinteo.webrtc.channels", gn = "application/vinteo.webrtc.mediastate", Nn = "application/vinteo.webrtc.refusal", Ge = "application/vinteo.webrtc.maincam", mn = "application/vinteo.webrtc.mic", Rn = "application/vinteo.webrtc.uselic", An = "X-WEBRTC-USE-LICENSE", Xe = "X-WEBRTC-INPUT-CHANNELS", ze = "X-WEBRTC-OUTPUT-CHANNELS", fn = "X-WEBRTC-MAINCAM", In = "X-WEBRTC-MIC", Ke = "X-WEBRTC-SYNC", Mn = "X-WEBRTC-MAINCAM-RESOLUTION", On = "X-WEBRTC-MEDIA-STATE", Pn = "X-Vinteo-Media-Type", Dn = "X-Vinteo-MainCam-State", pn = "X-Vinteo-Mic-State", vn = "application/vinteo.webrtc.notify", yn = "X-VINTEO-NOTIFY", H = "x-webrtc-share-state", bn = `${H}: LETMESTARTPRESENTATION`, wn = `${H}: STOPPRESENTATION`, yt = "YOUCANRECEIVECONTENT", bt = "CONTENTEND", Un = "YOUMUSTSTOPSENDCONTENT", Ln = `${H}: ${yt}`, Bn = `${H}: ${bt}`, Fn = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", kn = `${Fn}: LETMESTARTMAINCAM`, Ve = "sip-connector", E = ne(Ve), lr = () => {
|
|
196
|
+
ne.enable(`${Ve}`);
|
|
197
|
+
}, dr = () => {
|
|
198
|
+
ne.enable(`-${Ve}`);
|
|
127
199
|
};
|
|
128
|
-
var
|
|
129
|
-
function
|
|
130
|
-
return (
|
|
200
|
+
var I = /* @__PURE__ */ ((n) => (n.PAUSE_MAIN_CAM = "PAUSEMAINCAM", n.RESUME_MAIN_CAM = "RESUMEMAINCAM", n.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", n.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", n.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", n))(I || {}), Z = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(Z || {}), ee = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(ee || {}), Hn = /* @__PURE__ */ ((n) => (n.AUDIO = "AUDIO", n.VIDEO = "VIDEO", n.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", n))(Hn || {});
|
|
201
|
+
function Vn(n) {
|
|
202
|
+
return (e) => `sip:${e}@${n}`;
|
|
131
203
|
}
|
|
132
|
-
const
|
|
133
|
-
videoMode:
|
|
134
|
-
audioMode:
|
|
204
|
+
const Wn = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, Je = (n) => n.trim().replaceAll(" ", "_"), qn = Wn(1e5, 99999999), J = (n, {
|
|
205
|
+
videoMode: e,
|
|
206
|
+
audioMode: t
|
|
135
207
|
} = {}) => {
|
|
136
|
-
if (!
|
|
208
|
+
if (!n || e === "recvonly" && t === "recvonly")
|
|
137
209
|
return;
|
|
138
|
-
const
|
|
210
|
+
const s = t === "recvonly" ? [] : n.getAudioTracks(), r = e === "recvonly" ? [] : n.getVideoTracks(), o = [...s, ...r], i = new MediaStream(o);
|
|
139
211
|
return i.getTracks = () => [...i.getAudioTracks(), ...i.getVideoTracks()], i;
|
|
140
|
-
},
|
|
141
|
-
const { kind:
|
|
142
|
-
return
|
|
143
|
-
}),
|
|
144
|
-
|
|
145
|
-
),
|
|
146
|
-
const
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
|
|
212
|
+
}, $n = (n) => n.some((t) => {
|
|
213
|
+
const { kind: s } = t;
|
|
214
|
+
return s === "video";
|
|
215
|
+
}), xn = "Error decline with 603", Yn = (n) => n.message === xn, Gn = (n, e) => n.find((t) => t.track && e.getTracks().includes(t.track)), wt = 1, Ut = (n) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== n, Xn = Ut(
|
|
216
|
+
wt
|
|
217
|
+
), zn = (n, e) => {
|
|
218
|
+
const t = n === void 0 ? void 0 : Math.max(n, wt);
|
|
219
|
+
if (t !== void 0 && Xn(
|
|
220
|
+
t,
|
|
221
|
+
e
|
|
150
222
|
))
|
|
223
|
+
return t;
|
|
224
|
+
}, Kn = Ut(), Jn = (n, e) => {
|
|
225
|
+
if (Kn(n, e))
|
|
151
226
|
return n;
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
(r.encodings === void 0 || r.encodings.length === 0) && (r.encodings = [{}]);
|
|
158
|
-
const [s] = r.encodings, o = s.scaleResolutionDownBy, i = rs(
|
|
159
|
-
t.scaleResolutionDownBy,
|
|
227
|
+
}, Lt = async (n, e, t) => {
|
|
228
|
+
const s = n.getParameters();
|
|
229
|
+
(s.encodings === void 0 || s.encodings.length === 0) && (s.encodings = [{}]);
|
|
230
|
+
const [r] = s.encodings, o = r.scaleResolutionDownBy, i = zn(
|
|
231
|
+
e.scaleResolutionDownBy,
|
|
160
232
|
o
|
|
161
233
|
);
|
|
162
|
-
let
|
|
163
|
-
i !== void 0 && (
|
|
164
|
-
const u =
|
|
165
|
-
return
|
|
166
|
-
},
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
return
|
|
170
|
-
},
|
|
171
|
-
const { originator:
|
|
172
|
-
return
|
|
173
|
-
},
|
|
174
|
-
class
|
|
175
|
-
constructor({ JsSIP:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
234
|
+
let c = !1;
|
|
235
|
+
i !== void 0 && (s.encodings[0].scaleResolutionDownBy = i, c = !0);
|
|
236
|
+
const u = r.maxBitrate, _ = Jn(e.maxBitrate, u);
|
|
237
|
+
return _ !== void 0 && (s.encodings[0].maxBitrate = _, c = !0), c ? (t && t(s), n.setParameters(s).then(() => ({ parameters: s, isChanged: c }))) : { parameters: s, isChanged: c };
|
|
238
|
+
}, Qn = async (n, e, t) => {
|
|
239
|
+
const s = Gn(n, e);
|
|
240
|
+
if (s)
|
|
241
|
+
return Lt(s, { maxBitrate: t });
|
|
242
|
+
}, jn = 486, Zn = 487, te = "local", Qe = "remote", Sr = (n = new Error()) => {
|
|
243
|
+
const { originator: e, cause: t } = n;
|
|
244
|
+
return et(n) ? !0 : typeof t == "string" ? t === tt || t === nt || e === te && (t === rt || t === st) : !1;
|
|
245
|
+
}, P = "SipConnector", es = "channels", ts = "WebcastStarted", ns = "WebcastStopped", ss = "accountChanged", rs = "accountDeleted", os = "addedToListModerators", is = "removedFromListModerators", as = "WebcastParticipationAccepted", cs = "WebcastParticipationRejected", us = "ParticipantMovedToWebcast", Es = "ConferenceParticipantTokenIssued";
|
|
246
|
+
class hr {
|
|
247
|
+
constructor({ JsSIP: e }) {
|
|
248
|
+
a(this, "_isRegisterConfig", !1);
|
|
249
|
+
a(this, "_connectionConfiguration", {});
|
|
250
|
+
a(this, "_remoteStreams", {});
|
|
251
|
+
a(this, "JsSIP");
|
|
252
|
+
a(this, "_sessionEvents");
|
|
253
|
+
a(this, "_uaEvents");
|
|
254
|
+
a(this, "_cancelableConnect");
|
|
255
|
+
a(this, "_cancelableCreateUa");
|
|
256
|
+
a(this, "_cancelableDisconnect");
|
|
257
|
+
a(this, "_cancelableSet");
|
|
258
|
+
a(this, "_cancelableCall");
|
|
259
|
+
a(this, "_cancelableAnswer");
|
|
260
|
+
a(this, "_cancelableSendDTMF");
|
|
261
|
+
a(this, "getSipServerUrl", (e) => e);
|
|
262
|
+
a(this, "promisePendingStartPresentation");
|
|
263
|
+
a(this, "promisePendingStopPresentation");
|
|
264
|
+
a(this, "ua");
|
|
265
|
+
a(this, "session");
|
|
266
|
+
a(this, "incomingSession");
|
|
267
|
+
a(this, "_streamPresentationCurrent");
|
|
268
|
+
a(this, "socket");
|
|
269
|
+
a(this, "connect", async (e) => (this._cancelRequests(), this._cancelableConnect.request(e)));
|
|
270
|
+
a(this, "createUa", async (e) => this._cancelableCreateUa.request(e));
|
|
271
|
+
a(this, "set", async (e) => this._cancelableSet.request(e));
|
|
272
|
+
a(this, "call", async (e) => this._cancelableCall.request(e));
|
|
273
|
+
a(this, "disconnect", async () => (this._cancelRequests(), this._disconnectWithoutCancelRequests()));
|
|
274
|
+
a(this, "answerToIncomingCall", async (e) => this._cancelableAnswer.request(e));
|
|
275
|
+
a(this, "sendDTMF", async (e) => this._cancelableSendDTMF.request(e));
|
|
276
|
+
a(this, "hangUp", async () => (this._cancelRequests(), this._hangUpWithoutCancelRequests()));
|
|
277
|
+
a(this, "tryRegister", async () => {
|
|
206
278
|
if (!this.isRegisterConfig)
|
|
207
279
|
throw new Error("Config is not registered");
|
|
208
|
-
this._uaEvents.trigger(
|
|
280
|
+
this._uaEvents.trigger(z, void 0);
|
|
209
281
|
try {
|
|
210
282
|
await this.unregister();
|
|
211
|
-
} catch (
|
|
212
|
-
|
|
283
|
+
} catch (e) {
|
|
284
|
+
E("tryRegister", e);
|
|
213
285
|
}
|
|
214
286
|
return this.register();
|
|
215
287
|
});
|
|
216
|
-
|
|
288
|
+
a(this, "declineToIncomingCall", async ({ statusCode: e = Zn } = {}) => new Promise((t, s) => {
|
|
217
289
|
if (!this.isAvailableIncomingCall) {
|
|
218
|
-
|
|
290
|
+
s(new Error("no incomingSession"));
|
|
219
291
|
return;
|
|
220
292
|
}
|
|
221
|
-
const
|
|
222
|
-
this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest(), this.removeIncomingSession(), this._uaEvents.trigger(
|
|
293
|
+
const r = this.incomingSession, o = this.remoteCallerData;
|
|
294
|
+
this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest(), this.removeIncomingSession(), this._uaEvents.trigger(ie, o), t(r.terminate({ status_code: e }));
|
|
223
295
|
}));
|
|
224
|
-
|
|
225
|
-
|
|
296
|
+
a(this, "busyIncomingCall", async () => this.declineToIncomingCall({ statusCode: jn }));
|
|
297
|
+
a(this, "removeIncomingSession", () => {
|
|
226
298
|
delete this.incomingSession;
|
|
227
299
|
});
|
|
228
|
-
|
|
229
|
-
if (
|
|
230
|
-
this.incomingSession =
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
this.removeIncomingSession(),
|
|
234
|
-
}), this._uaEvents.trigger(
|
|
300
|
+
a(this, "handleNewRTCSession", ({ originator: e, session: t }) => {
|
|
301
|
+
if (e === Qe) {
|
|
302
|
+
this.incomingSession = t;
|
|
303
|
+
const s = this.remoteCallerData;
|
|
304
|
+
t.on(y, (r) => {
|
|
305
|
+
this.removeIncomingSession(), r.originator === te ? this._uaEvents.trigger(ce, s) : this._uaEvents.trigger(ae, s);
|
|
306
|
+
}), this._uaEvents.trigger(oe, s);
|
|
235
307
|
}
|
|
236
308
|
});
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
displayName:
|
|
240
|
-
user:
|
|
241
|
-
password:
|
|
242
|
-
register:
|
|
309
|
+
a(this, "_connect", async (e) => this.createUa(e).then(async () => this._start()));
|
|
310
|
+
a(this, "_createUa", async ({
|
|
311
|
+
displayName: e = "",
|
|
312
|
+
user: t,
|
|
313
|
+
password: s,
|
|
314
|
+
register: r = !1,
|
|
243
315
|
sipServerUrl: o,
|
|
244
316
|
sipWebSocketServerURL: i,
|
|
245
|
-
remoteAddress:
|
|
317
|
+
remoteAddress: c,
|
|
246
318
|
extraHeaders: u = [],
|
|
247
|
-
sdpSemantics:
|
|
248
|
-
sessionTimers:
|
|
249
|
-
registerExpires:
|
|
319
|
+
sdpSemantics: _ = "plan-b",
|
|
320
|
+
sessionTimers: l = !1,
|
|
321
|
+
registerExpires: d = 60 * 5,
|
|
250
322
|
// 5 minutes in sec
|
|
251
|
-
connectionRecoveryMinInterval:
|
|
252
|
-
connectionRecoveryMaxInterval:
|
|
253
|
-
userAgent:
|
|
323
|
+
connectionRecoveryMinInterval: S = 2,
|
|
324
|
+
connectionRecoveryMaxInterval: h = 6,
|
|
325
|
+
userAgent: T
|
|
254
326
|
}) => {
|
|
255
327
|
if (!o)
|
|
256
328
|
throw new Error("sipServerUrl is required");
|
|
257
329
|
if (!i)
|
|
258
330
|
throw new Error("sipWebSocketServerURL is required");
|
|
259
|
-
if (
|
|
331
|
+
if (r && !t)
|
|
260
332
|
throw new Error("user is required for authorized connection");
|
|
261
|
-
if (
|
|
333
|
+
if (r && !s)
|
|
262
334
|
throw new Error("password is required for authorized connection");
|
|
263
335
|
this._connectionConfiguration = {
|
|
264
336
|
sipServerUrl: o,
|
|
265
|
-
displayName:
|
|
266
|
-
register:
|
|
267
|
-
user:
|
|
268
|
-
password:
|
|
337
|
+
displayName: e,
|
|
338
|
+
register: r,
|
|
339
|
+
user: t,
|
|
340
|
+
password: s
|
|
269
341
|
}, this._init({ sipServerUrl: o, sipWebSocketServerURL: i });
|
|
270
|
-
const
|
|
271
|
-
password:
|
|
272
|
-
register:
|
|
273
|
-
display_name:
|
|
274
|
-
user_agent:
|
|
275
|
-
sdp_semantics:
|
|
342
|
+
const g = r && t ? t.trim() : `${qn()}`, N = {
|
|
343
|
+
password: s,
|
|
344
|
+
register: r,
|
|
345
|
+
display_name: Je(e),
|
|
346
|
+
user_agent: T,
|
|
347
|
+
sdp_semantics: _,
|
|
276
348
|
sockets: [this.socket],
|
|
277
|
-
uri: this.getSipServerUrl(
|
|
278
|
-
session_timers:
|
|
279
|
-
register_expires:
|
|
280
|
-
connection_recovery_min_interval:
|
|
281
|
-
connection_recovery_max_interval:
|
|
349
|
+
uri: this.getSipServerUrl(g),
|
|
350
|
+
session_timers: l,
|
|
351
|
+
register_expires: d,
|
|
352
|
+
connection_recovery_min_interval: S,
|
|
353
|
+
connection_recovery_max_interval: h
|
|
282
354
|
};
|
|
283
|
-
this.ua && await this._disconnectWithoutCancelRequests(), this._isRegisterConfig = !!
|
|
284
|
-
const
|
|
285
|
-
|
|
355
|
+
this.ua && await this._disconnectWithoutCancelRequests(), this._isRegisterConfig = !!N.register, this.ua = new this.JsSIP.UA(N), this._uaEvents.eachTriggers((m, R) => {
|
|
356
|
+
const v = ke.find((f) => f === R);
|
|
357
|
+
v && this.ua && this.ua.on(v, m);
|
|
286
358
|
});
|
|
287
|
-
const
|
|
288
|
-
return this.ua.registrator().setExtraHeaders(
|
|
359
|
+
const M = [...dn(c), ...u];
|
|
360
|
+
return this.ua.registrator().setExtraHeaders(M), this.ua;
|
|
289
361
|
});
|
|
290
|
-
|
|
291
|
-
const { ua:
|
|
292
|
-
if (!
|
|
293
|
-
|
|
362
|
+
a(this, "_start", async () => new Promise((e, t) => {
|
|
363
|
+
const { ua: s } = this;
|
|
364
|
+
if (!s) {
|
|
365
|
+
t(new Error("this.ua is not initialized"));
|
|
294
366
|
return;
|
|
295
367
|
}
|
|
296
|
-
const
|
|
297
|
-
|
|
368
|
+
const r = () => {
|
|
369
|
+
c(), e(s);
|
|
298
370
|
}, o = (u) => {
|
|
299
|
-
|
|
371
|
+
c(), t(u);
|
|
300
372
|
}, i = () => {
|
|
301
|
-
this.isRegisterConfig ? (this.on(
|
|
302
|
-
},
|
|
303
|
-
this.off(
|
|
373
|
+
this.isRegisterConfig ? (this.on(L, r), this.on(B, o)) : this.on(V, r), this.on(D, o);
|
|
374
|
+
}, c = () => {
|
|
375
|
+
this.off(L, r), this.off(B, o), this.off(V, r), this.off(D, o);
|
|
304
376
|
};
|
|
305
|
-
i(), this.on(
|
|
377
|
+
i(), this.on(W, this.handleNewRTCSession), s.start();
|
|
306
378
|
}));
|
|
307
|
-
|
|
379
|
+
a(this, "_set", async ({ displayName: e, password: t }) => new Promise((s, r) => {
|
|
308
380
|
const { ua: o } = this;
|
|
309
381
|
if (!o) {
|
|
310
|
-
|
|
382
|
+
r(new Error("this.ua is not initialized"));
|
|
311
383
|
return;
|
|
312
384
|
}
|
|
313
|
-
let i = !1,
|
|
314
|
-
|
|
315
|
-
const u = i ||
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}).catch(
|
|
385
|
+
let i = !1, c = !1;
|
|
386
|
+
e !== void 0 && e !== this._connectionConfiguration.displayName && (i = o.set("display_name", Je(e)), this._connectionConfiguration.displayName = e), t !== void 0 && t !== this._connectionConfiguration.password && (c = o.set("password", t), this._connectionConfiguration.password = t);
|
|
387
|
+
const u = i || c;
|
|
388
|
+
c && this.isRegisterConfig ? this.register().then(() => {
|
|
389
|
+
s(u);
|
|
390
|
+
}).catch(r) : u ? s(u) : r(u);
|
|
319
391
|
}));
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
this.off(
|
|
323
|
-
const
|
|
324
|
-
this.once(
|
|
325
|
-
delete this.ua,
|
|
392
|
+
a(this, "_disconnectWithoutCancelRequests", async () => this._cancelableDisconnect.request());
|
|
393
|
+
a(this, "_disconnect", async () => {
|
|
394
|
+
this.off(W, this.handleNewRTCSession);
|
|
395
|
+
const e = new Promise((t) => {
|
|
396
|
+
this.once(D, () => {
|
|
397
|
+
delete this.ua, t();
|
|
326
398
|
});
|
|
327
399
|
});
|
|
328
|
-
return this.ua ? (await this._hangUpWithoutCancelRequests(), this.ua ? this.ua.stop() : this._uaEvents.trigger(
|
|
400
|
+
return this.ua ? (await this._hangUpWithoutCancelRequests(), this.ua ? this.ua.stop() : this._uaEvents.trigger(D, void 0)) : this._uaEvents.trigger(D, void 0), e;
|
|
329
401
|
});
|
|
330
|
-
|
|
331
|
-
number:
|
|
332
|
-
mediaStream:
|
|
333
|
-
extraHeaders:
|
|
334
|
-
ontrack:
|
|
402
|
+
a(this, "_call", async ({
|
|
403
|
+
number: e,
|
|
404
|
+
mediaStream: t,
|
|
405
|
+
extraHeaders: s = [],
|
|
406
|
+
ontrack: r,
|
|
335
407
|
iceServers: o,
|
|
336
408
|
videoMode: i,
|
|
337
|
-
audioMode:
|
|
409
|
+
audioMode: c,
|
|
338
410
|
degradationPreference: u,
|
|
339
|
-
offerToReceiveAudio:
|
|
340
|
-
offerToReceiveVideo:
|
|
341
|
-
}) => new Promise((
|
|
342
|
-
const { ua:
|
|
343
|
-
if (!
|
|
344
|
-
|
|
411
|
+
offerToReceiveAudio: _ = !0,
|
|
412
|
+
offerToReceiveVideo: l = !0
|
|
413
|
+
}) => new Promise((d, S) => {
|
|
414
|
+
const { ua: h } = this;
|
|
415
|
+
if (!h) {
|
|
416
|
+
S(new Error("this.ua is not initialized"));
|
|
345
417
|
return;
|
|
346
418
|
}
|
|
347
|
-
this._connectionConfiguration.number =
|
|
348
|
-
extraHeaders:
|
|
349
|
-
mediaStream:
|
|
419
|
+
this._connectionConfiguration.number = e, this._connectionConfiguration.answer = !1, this._handleCall({ ontrack: r }).then(d).catch(S), this.session = h.call(this.getSipServerUrl(e), {
|
|
420
|
+
extraHeaders: s,
|
|
421
|
+
mediaStream: J(t, {
|
|
350
422
|
videoMode: i,
|
|
351
|
-
audioMode:
|
|
423
|
+
audioMode: c
|
|
352
424
|
}),
|
|
353
425
|
eventHandlers: this._sessionEvents.triggers,
|
|
354
426
|
videoMode: i,
|
|
355
|
-
audioMode:
|
|
427
|
+
audioMode: c,
|
|
356
428
|
degradationPreference: u,
|
|
357
429
|
pcConfig: {
|
|
358
430
|
iceServers: o
|
|
359
431
|
},
|
|
360
432
|
rtcOfferConstraints: {
|
|
361
|
-
offerToReceiveAudio:
|
|
362
|
-
offerToReceiveVideo:
|
|
433
|
+
offerToReceiveAudio: _,
|
|
434
|
+
offerToReceiveVideo: l
|
|
363
435
|
}
|
|
364
436
|
});
|
|
365
437
|
}));
|
|
366
|
-
|
|
367
|
-
mediaStream:
|
|
368
|
-
ontrack:
|
|
369
|
-
extraHeaders:
|
|
370
|
-
iceServers:
|
|
438
|
+
a(this, "_answer", async ({
|
|
439
|
+
mediaStream: e,
|
|
440
|
+
ontrack: t,
|
|
441
|
+
extraHeaders: s = [],
|
|
442
|
+
iceServers: r,
|
|
371
443
|
videoMode: o,
|
|
372
444
|
audioMode: i,
|
|
373
|
-
degradationPreference:
|
|
374
|
-
}) => new Promise((u,
|
|
445
|
+
degradationPreference: c
|
|
446
|
+
}) => new Promise((u, _) => {
|
|
375
447
|
if (!this.isAvailableIncomingCall) {
|
|
376
|
-
|
|
448
|
+
_(new Error("no incomingSession"));
|
|
377
449
|
return;
|
|
378
450
|
}
|
|
379
451
|
this.session = this.incomingSession, this.removeIncomingSession();
|
|
380
|
-
const { session:
|
|
381
|
-
if (!
|
|
382
|
-
|
|
452
|
+
const { session: l } = this;
|
|
453
|
+
if (!l) {
|
|
454
|
+
_(new Error("No session established"));
|
|
383
455
|
return;
|
|
384
456
|
}
|
|
385
|
-
this._sessionEvents.eachTriggers((
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
}), this._connectionConfiguration.answer = !0, this._connectionConfiguration.number =
|
|
389
|
-
const
|
|
457
|
+
this._sessionEvents.eachTriggers((S, h) => {
|
|
458
|
+
const T = He.find((g) => g === h);
|
|
459
|
+
T && l.on(T, S);
|
|
460
|
+
}), this._connectionConfiguration.answer = !0, this._connectionConfiguration.number = l.remote_identity.uri.user, this._handleCall({ ontrack: t }).then(u).catch(_);
|
|
461
|
+
const d = J(e, {
|
|
390
462
|
videoMode: o,
|
|
391
463
|
audioMode: i
|
|
392
464
|
});
|
|
393
|
-
|
|
394
|
-
extraHeaders:
|
|
465
|
+
l.answer({
|
|
466
|
+
extraHeaders: s,
|
|
395
467
|
videoMode: o,
|
|
396
468
|
audioMode: i,
|
|
397
|
-
degradationPreference:
|
|
398
|
-
mediaStream:
|
|
469
|
+
degradationPreference: c,
|
|
470
|
+
mediaStream: d,
|
|
399
471
|
pcConfig: {
|
|
400
|
-
iceServers:
|
|
472
|
+
iceServers: r
|
|
401
473
|
}
|
|
402
474
|
});
|
|
403
475
|
}));
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
this.onSession(
|
|
476
|
+
a(this, "_handleCall", async ({ ontrack: e }) => new Promise((t, s) => {
|
|
477
|
+
const r = () => {
|
|
478
|
+
this.onSession(G, l), this.onSession(Y, d);
|
|
407
479
|
}, o = () => {
|
|
408
|
-
this.offSession(
|
|
480
|
+
this.offSession(G, l), this.offSession(Y, d);
|
|
409
481
|
}, i = () => {
|
|
410
|
-
this.onSession(
|
|
411
|
-
},
|
|
412
|
-
this.offSession(
|
|
413
|
-
}, u = (
|
|
414
|
-
o(),
|
|
482
|
+
this.onSession(y, u), this.onSession(F, u);
|
|
483
|
+
}, c = () => {
|
|
484
|
+
this.offSession(y, u), this.offSession(F, u);
|
|
485
|
+
}, u = (S) => {
|
|
486
|
+
o(), c(), s(S);
|
|
415
487
|
};
|
|
416
|
-
let
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
this._sessionEvents.trigger(
|
|
488
|
+
let _;
|
|
489
|
+
const l = ({ peerconnection: S }) => {
|
|
490
|
+
_ = S, _.ontrack = (h) => {
|
|
491
|
+
this._sessionEvents.trigger(Ce, _), e && e(h);
|
|
420
492
|
};
|
|
421
|
-
},
|
|
422
|
-
|
|
493
|
+
}, d = () => {
|
|
494
|
+
_ && this._sessionEvents.trigger(Te, _), o(), c(), t(_);
|
|
423
495
|
};
|
|
424
|
-
|
|
496
|
+
r(), i();
|
|
425
497
|
}));
|
|
426
|
-
|
|
498
|
+
a(this, "_restoreSession", () => {
|
|
427
499
|
this._resetPresentation(), delete this._connectionConfiguration.number, delete this.session, this._remoteStreams = {};
|
|
428
500
|
});
|
|
429
|
-
|
|
430
|
-
const { session:
|
|
431
|
-
if (!
|
|
432
|
-
|
|
501
|
+
a(this, "_sendDTMF", async (e) => new Promise((t, s) => {
|
|
502
|
+
const { session: r } = this;
|
|
503
|
+
if (!r) {
|
|
504
|
+
s(new Error("No session established"));
|
|
433
505
|
return;
|
|
434
506
|
}
|
|
435
|
-
this.onceSession(
|
|
436
|
-
o ===
|
|
437
|
-
}),
|
|
507
|
+
this.onceSession(Le, ({ originator: o }) => {
|
|
508
|
+
o === te && t();
|
|
509
|
+
}), r.sendDTMF(e, {
|
|
438
510
|
duration: 120,
|
|
439
511
|
interToneGap: 600
|
|
440
512
|
});
|
|
441
513
|
}));
|
|
442
|
-
|
|
514
|
+
a(this, "_hangUpWithoutCancelRequests", async () => {
|
|
443
515
|
if (this.ua && this.session) {
|
|
444
|
-
const { session:
|
|
445
|
-
this._streamPresentationCurrent && await this.stopPresentation(), this._restoreSession(),
|
|
516
|
+
const { session: e } = this;
|
|
517
|
+
this._streamPresentationCurrent && await this.stopPresentation(), this._restoreSession(), e.isEnded() || e.terminate();
|
|
446
518
|
}
|
|
447
519
|
});
|
|
448
|
-
|
|
449
|
-
switch (
|
|
450
|
-
case
|
|
451
|
-
this._sessionEvents.trigger(
|
|
520
|
+
a(this, "_handleShareState", (e) => {
|
|
521
|
+
switch (e) {
|
|
522
|
+
case yt: {
|
|
523
|
+
this._sessionEvents.trigger(_e, void 0);
|
|
452
524
|
break;
|
|
453
525
|
}
|
|
454
|
-
case
|
|
455
|
-
this._sessionEvents.trigger(
|
|
526
|
+
case bt: {
|
|
527
|
+
this._sessionEvents.trigger(le, void 0);
|
|
456
528
|
break;
|
|
457
529
|
}
|
|
458
|
-
case
|
|
459
|
-
this._sessionEvents.trigger(
|
|
530
|
+
case Un: {
|
|
531
|
+
this._sessionEvents.trigger(de, void 0);
|
|
460
532
|
break;
|
|
461
533
|
}
|
|
462
534
|
}
|
|
463
535
|
});
|
|
464
|
-
|
|
465
|
-
const
|
|
466
|
-
if (
|
|
467
|
-
const
|
|
468
|
-
inputChannels:
|
|
469
|
-
outputChannels:
|
|
536
|
+
a(this, "_maybeTriggerChannels", (e) => {
|
|
537
|
+
const t = e.getHeader(Xe), s = e.getHeader(ze);
|
|
538
|
+
if (t && s) {
|
|
539
|
+
const r = {
|
|
540
|
+
inputChannels: t,
|
|
541
|
+
outputChannels: s
|
|
470
542
|
};
|
|
471
|
-
this._sessionEvents.trigger(
|
|
543
|
+
this._sessionEvents.trigger($, r);
|
|
472
544
|
}
|
|
473
545
|
});
|
|
474
|
-
|
|
475
|
-
switch (
|
|
476
|
-
case
|
|
477
|
-
const
|
|
478
|
-
this._triggerChannelsNotify(
|
|
546
|
+
a(this, "_handleNotify", (e) => {
|
|
547
|
+
switch (e.cmd) {
|
|
548
|
+
case es: {
|
|
549
|
+
const t = e;
|
|
550
|
+
this._triggerChannelsNotify(t);
|
|
479
551
|
break;
|
|
480
552
|
}
|
|
481
|
-
case
|
|
482
|
-
const
|
|
483
|
-
this._triggerWebcastStartedNotify(
|
|
553
|
+
case ts: {
|
|
554
|
+
const t = e;
|
|
555
|
+
this._triggerWebcastStartedNotify(t);
|
|
484
556
|
break;
|
|
485
557
|
}
|
|
486
|
-
case
|
|
487
|
-
const
|
|
488
|
-
this._triggerWebcastStoppedNotify(
|
|
558
|
+
case ns: {
|
|
559
|
+
const t = e;
|
|
560
|
+
this._triggerWebcastStoppedNotify(t);
|
|
489
561
|
break;
|
|
490
562
|
}
|
|
491
|
-
case
|
|
492
|
-
const
|
|
493
|
-
this._triggerAddedToListModeratorsNotify(
|
|
563
|
+
case os: {
|
|
564
|
+
const t = e;
|
|
565
|
+
this._triggerAddedToListModeratorsNotify(t);
|
|
494
566
|
break;
|
|
495
567
|
}
|
|
496
|
-
case
|
|
497
|
-
const
|
|
498
|
-
this._triggerRemovedFromListModeratorsNotify(
|
|
568
|
+
case is: {
|
|
569
|
+
const t = e;
|
|
570
|
+
this._triggerRemovedFromListModeratorsNotify(t);
|
|
499
571
|
break;
|
|
500
572
|
}
|
|
501
|
-
case
|
|
502
|
-
const
|
|
503
|
-
this._triggerParticipantMoveRequestToConference(
|
|
573
|
+
case as: {
|
|
574
|
+
const t = e;
|
|
575
|
+
this._triggerParticipantMoveRequestToConference(t);
|
|
504
576
|
break;
|
|
505
577
|
}
|
|
506
|
-
case
|
|
507
|
-
const
|
|
508
|
-
this._triggerParticipantCancelingWordRequest(
|
|
578
|
+
case cs: {
|
|
579
|
+
const t = e;
|
|
580
|
+
this._triggerParticipantCancelingWordRequest(t);
|
|
509
581
|
break;
|
|
510
582
|
}
|
|
511
|
-
case
|
|
512
|
-
const
|
|
513
|
-
this._triggerParticipantMoveRequestToStream(
|
|
583
|
+
case us: {
|
|
584
|
+
const t = e;
|
|
585
|
+
this._triggerParticipantMoveRequestToStream(t);
|
|
514
586
|
break;
|
|
515
587
|
}
|
|
516
|
-
case
|
|
588
|
+
case ss: {
|
|
517
589
|
this._triggerAccountChangedNotify();
|
|
518
590
|
break;
|
|
519
591
|
}
|
|
520
|
-
case
|
|
592
|
+
case rs: {
|
|
521
593
|
this._triggerAccountDeletedNotify();
|
|
522
594
|
break;
|
|
523
595
|
}
|
|
524
|
-
case
|
|
525
|
-
const
|
|
526
|
-
this._triggerConferenceParticipantTokenIssued(
|
|
596
|
+
case Es: {
|
|
597
|
+
const t = e;
|
|
598
|
+
this._triggerConferenceParticipantTokenIssued(t);
|
|
527
599
|
break;
|
|
528
600
|
}
|
|
529
601
|
default:
|
|
530
|
-
|
|
602
|
+
E("unknown cmd", e.cmd);
|
|
531
603
|
}
|
|
532
604
|
});
|
|
533
|
-
|
|
534
|
-
conference:
|
|
605
|
+
a(this, "_triggerRemovedFromListModeratorsNotify", ({
|
|
606
|
+
conference: e
|
|
535
607
|
}) => {
|
|
536
|
-
const
|
|
537
|
-
conference:
|
|
608
|
+
const t = {
|
|
609
|
+
conference: e
|
|
538
610
|
};
|
|
539
611
|
this._uaEvents.trigger(
|
|
540
|
-
|
|
541
|
-
|
|
612
|
+
Oe,
|
|
613
|
+
t
|
|
542
614
|
);
|
|
543
615
|
});
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
conference:
|
|
616
|
+
a(this, "_triggerAddedToListModeratorsNotify", ({ conference: e }) => {
|
|
617
|
+
const t = {
|
|
618
|
+
conference: e
|
|
547
619
|
};
|
|
548
|
-
this._uaEvents.trigger(
|
|
620
|
+
this._uaEvents.trigger(Me, t);
|
|
549
621
|
});
|
|
550
|
-
|
|
551
|
-
const
|
|
552
|
-
conference:
|
|
553
|
-
type:
|
|
622
|
+
a(this, "_triggerWebcastStartedNotify", ({ body: { conference: e, type: t } }) => {
|
|
623
|
+
const s = {
|
|
624
|
+
conference: e,
|
|
625
|
+
type: t
|
|
554
626
|
};
|
|
555
|
-
this._uaEvents.trigger(
|
|
627
|
+
this._uaEvents.trigger(ve, s);
|
|
556
628
|
});
|
|
557
|
-
|
|
558
|
-
const
|
|
559
|
-
conference:
|
|
560
|
-
type:
|
|
629
|
+
a(this, "_triggerWebcastStoppedNotify", ({ body: { conference: e, type: t } }) => {
|
|
630
|
+
const s = {
|
|
631
|
+
conference: e,
|
|
632
|
+
type: t
|
|
561
633
|
};
|
|
562
|
-
this._uaEvents.trigger(
|
|
634
|
+
this._uaEvents.trigger(ye, s);
|
|
563
635
|
});
|
|
564
|
-
|
|
565
|
-
this._uaEvents.trigger(
|
|
636
|
+
a(this, "_triggerAccountChangedNotify", () => {
|
|
637
|
+
this._uaEvents.trigger(be, void 0);
|
|
566
638
|
});
|
|
567
|
-
|
|
568
|
-
this._uaEvents.trigger(
|
|
639
|
+
a(this, "_triggerAccountDeletedNotify", () => {
|
|
640
|
+
this._uaEvents.trigger(we, void 0);
|
|
569
641
|
});
|
|
570
|
-
|
|
571
|
-
body: { conference:
|
|
642
|
+
a(this, "_triggerConferenceParticipantTokenIssued", ({
|
|
643
|
+
body: { conference: e, participant: t, jwt: s }
|
|
572
644
|
}) => {
|
|
573
|
-
const
|
|
574
|
-
conference:
|
|
575
|
-
participant:
|
|
576
|
-
jwt:
|
|
645
|
+
const r = {
|
|
646
|
+
conference: e,
|
|
647
|
+
participant: t,
|
|
648
|
+
jwt: s
|
|
577
649
|
};
|
|
578
650
|
this._uaEvents.trigger(
|
|
579
|
-
|
|
580
|
-
|
|
651
|
+
Ue,
|
|
652
|
+
r
|
|
581
653
|
);
|
|
582
654
|
});
|
|
583
|
-
|
|
584
|
-
const
|
|
585
|
-
inputChannels:
|
|
586
|
-
outputChannels:
|
|
655
|
+
a(this, "_triggerChannelsNotify", (e) => {
|
|
656
|
+
const t = e.input, s = e.output, r = {
|
|
657
|
+
inputChannels: t,
|
|
658
|
+
outputChannels: s
|
|
587
659
|
};
|
|
588
|
-
this._uaEvents.trigger(
|
|
660
|
+
this._uaEvents.trigger(ge, r);
|
|
589
661
|
});
|
|
590
|
-
|
|
591
|
-
body: { conference:
|
|
662
|
+
a(this, "_triggerParticipantMoveRequestToConference", ({
|
|
663
|
+
body: { conference: e }
|
|
592
664
|
}) => {
|
|
593
|
-
const
|
|
594
|
-
conference:
|
|
665
|
+
const t = {
|
|
666
|
+
conference: e
|
|
595
667
|
};
|
|
596
|
-
this._uaEvents.trigger(
|
|
668
|
+
this._uaEvents.trigger(Pe, t);
|
|
597
669
|
});
|
|
598
|
-
|
|
599
|
-
body: { conference:
|
|
670
|
+
a(this, "_triggerParticipantCancelingWordRequest", ({
|
|
671
|
+
body: { conference: e }
|
|
600
672
|
}) => {
|
|
601
|
-
const
|
|
602
|
-
conference:
|
|
673
|
+
const t = {
|
|
674
|
+
conference: e
|
|
603
675
|
};
|
|
604
|
-
this._uaEvents.trigger(
|
|
676
|
+
this._uaEvents.trigger(pe, t);
|
|
605
677
|
});
|
|
606
|
-
|
|
607
|
-
body: { conference:
|
|
678
|
+
a(this, "_triggerParticipantMoveRequestToStream", ({
|
|
679
|
+
body: { conference: e }
|
|
608
680
|
}) => {
|
|
609
|
-
const
|
|
610
|
-
conference:
|
|
681
|
+
const t = {
|
|
682
|
+
conference: e
|
|
611
683
|
};
|
|
612
|
-
this._uaEvents.trigger(
|
|
684
|
+
this._uaEvents.trigger(De, t);
|
|
613
685
|
});
|
|
614
|
-
|
|
615
|
-
const
|
|
616
|
-
this._sessionEvents.trigger(
|
|
686
|
+
a(this, "_triggerEnterRoom", (e) => {
|
|
687
|
+
const t = e.getHeader(hn);
|
|
688
|
+
this._sessionEvents.trigger(Se, t);
|
|
617
689
|
});
|
|
618
|
-
|
|
619
|
-
const
|
|
620
|
-
this._sessionEvents.trigger(
|
|
690
|
+
a(this, "_triggerShareState", (e) => {
|
|
691
|
+
const t = e.getHeader(H);
|
|
692
|
+
this._sessionEvents.trigger(q, t);
|
|
621
693
|
});
|
|
622
|
-
|
|
623
|
-
const
|
|
624
|
-
if (
|
|
625
|
-
this._sessionEvents.trigger(
|
|
626
|
-
else if (
|
|
627
|
-
this._sessionEvents.trigger(
|
|
628
|
-
else if ((
|
|
629
|
-
this._sessionEvents.trigger(
|
|
694
|
+
a(this, "_triggerMainCamControl", (e) => {
|
|
695
|
+
const t = e.getHeader(fn), s = e.getHeader(Ke), r = s === ee.ADMIN_SYNC_FORCED;
|
|
696
|
+
if (t === I.ADMIN_START_MAIN_CAM)
|
|
697
|
+
this._sessionEvents.trigger(Ae, { isSyncForced: r });
|
|
698
|
+
else if (t === I.ADMIN_STOP_MAIN_CAM)
|
|
699
|
+
this._sessionEvents.trigger(Re, { isSyncForced: r });
|
|
700
|
+
else if ((t === I.RESUME_MAIN_CAM || t === I.PAUSE_MAIN_CAM) && s)
|
|
701
|
+
this._sessionEvents.trigger(x, { isSyncForced: r });
|
|
630
702
|
else {
|
|
631
|
-
const o =
|
|
632
|
-
this._sessionEvents.trigger(
|
|
633
|
-
mainCam:
|
|
703
|
+
const o = e.getHeader(Mn);
|
|
704
|
+
this._sessionEvents.trigger(me, {
|
|
705
|
+
mainCam: t,
|
|
634
706
|
resolutionMainCam: o
|
|
635
707
|
});
|
|
636
708
|
}
|
|
637
709
|
});
|
|
638
|
-
|
|
639
|
-
const
|
|
640
|
-
|
|
710
|
+
a(this, "_triggerMicControl", (e) => {
|
|
711
|
+
const t = e.getHeader(In), r = e.getHeader(Ke) === ee.ADMIN_SYNC_FORCED;
|
|
712
|
+
t === Z.ADMIN_START_MIC ? this._sessionEvents.trigger(Ie, { isSyncForced: r }) : t === Z.ADMIN_STOP_MIC && this._sessionEvents.trigger(fe, { isSyncForced: r });
|
|
641
713
|
});
|
|
642
|
-
|
|
643
|
-
const
|
|
644
|
-
this._sessionEvents.trigger(
|
|
714
|
+
a(this, "_triggerUseLicense", (e) => {
|
|
715
|
+
const t = e.getHeader(An);
|
|
716
|
+
this._sessionEvents.trigger(he, t);
|
|
645
717
|
});
|
|
646
|
-
|
|
647
|
-
const { originator:
|
|
648
|
-
if (
|
|
718
|
+
a(this, "_handleNewInfo", (e) => {
|
|
719
|
+
const { originator: t } = e;
|
|
720
|
+
if (t !== "remote")
|
|
649
721
|
return;
|
|
650
|
-
const { request:
|
|
651
|
-
if (
|
|
652
|
-
switch (
|
|
653
|
-
case
|
|
654
|
-
this._triggerEnterRoom(
|
|
722
|
+
const { request: s } = e, r = s.getHeader(Sn);
|
|
723
|
+
if (r)
|
|
724
|
+
switch (r) {
|
|
725
|
+
case Tn: {
|
|
726
|
+
this._triggerEnterRoom(s), this._maybeTriggerChannels(s);
|
|
655
727
|
break;
|
|
656
728
|
}
|
|
657
|
-
case
|
|
658
|
-
this._maybeHandleNotify(
|
|
729
|
+
case vn: {
|
|
730
|
+
this._maybeHandleNotify(s);
|
|
659
731
|
break;
|
|
660
732
|
}
|
|
661
|
-
case
|
|
662
|
-
this._triggerShareState(
|
|
733
|
+
case K: {
|
|
734
|
+
this._triggerShareState(s);
|
|
663
735
|
break;
|
|
664
736
|
}
|
|
665
|
-
case
|
|
666
|
-
this._triggerMainCamControl(
|
|
737
|
+
case Ge: {
|
|
738
|
+
this._triggerMainCamControl(s);
|
|
667
739
|
break;
|
|
668
740
|
}
|
|
669
|
-
case
|
|
670
|
-
this._triggerMicControl(
|
|
741
|
+
case mn: {
|
|
742
|
+
this._triggerMicControl(s);
|
|
671
743
|
break;
|
|
672
744
|
}
|
|
673
|
-
case
|
|
674
|
-
this._triggerUseLicense(
|
|
745
|
+
case Rn: {
|
|
746
|
+
this._triggerUseLicense(s);
|
|
675
747
|
break;
|
|
676
748
|
}
|
|
677
749
|
}
|
|
678
750
|
});
|
|
679
|
-
|
|
680
|
-
this._maybeHandleNotify(
|
|
751
|
+
a(this, "_handleSipEvent", ({ request: e }) => {
|
|
752
|
+
this._maybeHandleNotify(e);
|
|
681
753
|
});
|
|
682
|
-
|
|
683
|
-
const
|
|
684
|
-
if (
|
|
685
|
-
const
|
|
686
|
-
this._handleNotify(
|
|
754
|
+
a(this, "_maybeHandleNotify", (e) => {
|
|
755
|
+
const t = e.getHeader(yn);
|
|
756
|
+
if (t) {
|
|
757
|
+
const s = JSON.parse(t);
|
|
758
|
+
this._handleNotify(s);
|
|
687
759
|
}
|
|
688
760
|
});
|
|
689
|
-
|
|
690
|
-
const { originator:
|
|
691
|
-
|
|
761
|
+
a(this, "_handleEnded", (e) => {
|
|
762
|
+
const { originator: t } = e;
|
|
763
|
+
t === Qe && this._sessionEvents.trigger(Ne, e), this._restoreSession();
|
|
692
764
|
});
|
|
693
|
-
this.JsSIP =
|
|
765
|
+
this.JsSIP = e, this._sessionEvents = new Ye(vt), this._uaEvents = new Ye(pt), this._cancelableConnect = new O(
|
|
694
766
|
this._connect,
|
|
695
767
|
{
|
|
696
|
-
moduleName:
|
|
768
|
+
moduleName: P,
|
|
697
769
|
afterCancelRequest: () => {
|
|
698
770
|
this._cancelableCreateUa.cancelRequest(), this._cancelableDisconnect.cancelRequest();
|
|
699
771
|
}
|
|
700
772
|
}
|
|
701
|
-
), this._cancelableCreateUa = new
|
|
773
|
+
), this._cancelableCreateUa = new O(this._createUa, { moduleName: P }), this._cancelableDisconnect = new O(
|
|
702
774
|
this._disconnect,
|
|
703
|
-
{ moduleName:
|
|
704
|
-
), this._cancelableSet = new
|
|
705
|
-
moduleName:
|
|
706
|
-
}), this._cancelableCall = new
|
|
775
|
+
{ moduleName: P }
|
|
776
|
+
), this._cancelableSet = new O(this._set, {
|
|
777
|
+
moduleName: P
|
|
778
|
+
}), this._cancelableCall = new O(
|
|
707
779
|
this._call,
|
|
708
|
-
{ moduleName:
|
|
709
|
-
), this._cancelableAnswer = new
|
|
780
|
+
{ moduleName: P }
|
|
781
|
+
), this._cancelableAnswer = new O(this._answer, { moduleName: P }), this._cancelableSendDTMF = new O(this._sendDTMF, { moduleName: P }), this.onSession(q, this._handleShareState), this.onSession(Be, this._handleNewInfo), this.on(Ee, this._handleSipEvent), this.onSession(y, this._handleEnded), this.onSession(F, this._handleEnded);
|
|
710
782
|
}
|
|
711
783
|
async register() {
|
|
712
|
-
return new Promise((
|
|
713
|
-
this.isRegisterConfig && this.ua ? (this.ua.on(
|
|
784
|
+
return new Promise((e, t) => {
|
|
785
|
+
this.isRegisterConfig && this.ua ? (this.ua.on(L, e), this.ua.on(B, t), this.ua.register()) : t(new Error("Config is not registered"));
|
|
714
786
|
});
|
|
715
787
|
}
|
|
716
788
|
async unregister() {
|
|
717
|
-
return new Promise((
|
|
718
|
-
this.isRegistered && this.ua ? (this.ua.on(
|
|
789
|
+
return new Promise((e, t) => {
|
|
790
|
+
this.isRegistered && this.ua ? (this.ua.on(ue, e), this.ua.unregister()) : t(new Error("ua is not registered"));
|
|
719
791
|
});
|
|
720
792
|
}
|
|
721
|
-
async sendOptions(
|
|
793
|
+
async sendOptions(e, t, s) {
|
|
722
794
|
if (!this.ua)
|
|
723
795
|
throw new Error("is not connected");
|
|
724
|
-
return new Promise((
|
|
796
|
+
return new Promise((r, o) => {
|
|
725
797
|
try {
|
|
726
|
-
this.ua.sendOptions(
|
|
727
|
-
extraHeaders:
|
|
798
|
+
this.ua.sendOptions(e, t, {
|
|
799
|
+
extraHeaders: s,
|
|
728
800
|
eventHandlers: {
|
|
729
801
|
succeeded: () => {
|
|
730
|
-
|
|
802
|
+
r();
|
|
731
803
|
},
|
|
732
804
|
failed: o
|
|
733
805
|
}
|
|
@@ -737,65 +809,65 @@ class $l {
|
|
|
737
809
|
}
|
|
738
810
|
});
|
|
739
811
|
}
|
|
740
|
-
async ping(
|
|
741
|
-
var
|
|
742
|
-
if (!((
|
|
812
|
+
async ping(e, t) {
|
|
813
|
+
var r;
|
|
814
|
+
if (!((r = this.ua) != null && r.configuration.uri))
|
|
743
815
|
throw new Error("is not connected");
|
|
744
|
-
const
|
|
745
|
-
return this.sendOptions(
|
|
816
|
+
const s = this.ua.configuration.uri;
|
|
817
|
+
return this.sendOptions(s, e, t);
|
|
746
818
|
}
|
|
747
|
-
async replaceMediaStream(
|
|
819
|
+
async replaceMediaStream(e, t) {
|
|
748
820
|
if (!this.session)
|
|
749
821
|
throw new Error("No session established");
|
|
750
|
-
return this.session.replaceMediaStream(
|
|
822
|
+
return this.session.replaceMediaStream(e, t);
|
|
751
823
|
}
|
|
752
|
-
async askPermissionToEnableCam(
|
|
824
|
+
async askPermissionToEnableCam(e = {}) {
|
|
753
825
|
if (!this.session)
|
|
754
826
|
throw new Error("No session established");
|
|
755
|
-
const
|
|
756
|
-
return this.session.sendInfo(
|
|
827
|
+
const t = [kn];
|
|
828
|
+
return this.session.sendInfo(Ge, void 0, {
|
|
757
829
|
noTerminateWhenError: !0,
|
|
758
|
-
...
|
|
759
|
-
extraHeaders:
|
|
760
|
-
}).catch((
|
|
761
|
-
if (
|
|
762
|
-
throw
|
|
830
|
+
...e,
|
|
831
|
+
extraHeaders: t
|
|
832
|
+
}).catch((s) => {
|
|
833
|
+
if (Yn(s))
|
|
834
|
+
throw s;
|
|
763
835
|
});
|
|
764
836
|
}
|
|
765
837
|
get isPendingPresentation() {
|
|
766
838
|
return !!this.promisePendingStartPresentation || !!this.promisePendingStopPresentation;
|
|
767
839
|
}
|
|
768
|
-
async _sendPresentation(
|
|
769
|
-
maxBitrate:
|
|
770
|
-
degradationPreference:
|
|
840
|
+
async _sendPresentation(e, t, {
|
|
841
|
+
maxBitrate: s,
|
|
842
|
+
degradationPreference: r,
|
|
771
843
|
isNeedReinvite: o = !0,
|
|
772
844
|
isP2P: i = !1
|
|
773
845
|
}) {
|
|
774
|
-
const
|
|
775
|
-
this._streamPresentationCurrent =
|
|
776
|
-
const u = i ? [
|
|
846
|
+
const c = J(t);
|
|
847
|
+
this._streamPresentationCurrent = c;
|
|
848
|
+
const u = i ? [Ln] : [bn], _ = e.sendInfo(K, void 0, {
|
|
777
849
|
extraHeaders: u
|
|
778
|
-
}).then(async () =>
|
|
779
|
-
|
|
850
|
+
}).then(async () => e.startPresentation(
|
|
851
|
+
c,
|
|
780
852
|
o,
|
|
781
|
-
|
|
853
|
+
r
|
|
782
854
|
)).then(async () => {
|
|
783
|
-
const { connection:
|
|
784
|
-
if (!
|
|
855
|
+
const { connection: l } = this;
|
|
856
|
+
if (!l || s === void 0)
|
|
785
857
|
return;
|
|
786
|
-
const
|
|
787
|
-
return
|
|
788
|
-
}).then(() =>
|
|
789
|
-
throw this._sessionEvents.trigger(
|
|
858
|
+
const d = l.getSenders();
|
|
859
|
+
return Qn(d, t, s);
|
|
860
|
+
}).then(() => t).catch((l) => {
|
|
861
|
+
throw this._sessionEvents.trigger(X, l), l;
|
|
790
862
|
});
|
|
791
|
-
return this.promisePendingStartPresentation =
|
|
863
|
+
return this.promisePendingStartPresentation = _, _.finally(() => {
|
|
792
864
|
this.promisePendingStartPresentation = void 0;
|
|
793
865
|
});
|
|
794
866
|
}
|
|
795
|
-
async startPresentation(
|
|
796
|
-
isNeedReinvite:
|
|
797
|
-
isP2P:
|
|
798
|
-
maxBitrate:
|
|
867
|
+
async startPresentation(e, {
|
|
868
|
+
isNeedReinvite: t = !0,
|
|
869
|
+
isP2P: s = !1,
|
|
870
|
+
maxBitrate: r,
|
|
799
871
|
degradationPreference: o
|
|
800
872
|
} = {}) {
|
|
801
873
|
const i = this.establishedSession;
|
|
@@ -803,76 +875,76 @@ class $l {
|
|
|
803
875
|
throw new Error("No session established");
|
|
804
876
|
if (this._streamPresentationCurrent)
|
|
805
877
|
throw new Error("Presentation is already started");
|
|
806
|
-
return this._sendPresentation(i,
|
|
807
|
-
isNeedReinvite:
|
|
808
|
-
isP2P:
|
|
809
|
-
maxBitrate:
|
|
878
|
+
return this._sendPresentation(i, e, {
|
|
879
|
+
isNeedReinvite: t,
|
|
880
|
+
isP2P: s,
|
|
881
|
+
maxBitrate: r,
|
|
810
882
|
degradationPreference: o
|
|
811
883
|
});
|
|
812
884
|
}
|
|
813
885
|
async stopPresentation({
|
|
814
|
-
isP2P:
|
|
886
|
+
isP2P: e = !1
|
|
815
887
|
} = {}) {
|
|
816
|
-
const
|
|
817
|
-
let
|
|
818
|
-
const
|
|
819
|
-
return o &&
|
|
820
|
-
extraHeaders:
|
|
821
|
-
})).then(async () => o.stopPresentation(
|
|
822
|
-
throw this._sessionEvents.trigger(
|
|
823
|
-
})), !o &&
|
|
888
|
+
const t = this._streamPresentationCurrent;
|
|
889
|
+
let s = this.promisePendingStartPresentation ?? Promise.resolve();
|
|
890
|
+
const r = e ? [Bn] : [wn], o = this.establishedSession;
|
|
891
|
+
return o && t && (s = s.then(async () => o.sendInfo(K, void 0, {
|
|
892
|
+
extraHeaders: r
|
|
893
|
+
})).then(async () => o.stopPresentation(t)).catch((i) => {
|
|
894
|
+
throw this._sessionEvents.trigger(X, i), i;
|
|
895
|
+
})), !o && t && this._sessionEvents.trigger(Fe, t), this.promisePendingStopPresentation = s, s.finally(() => {
|
|
824
896
|
this._resetPresentation();
|
|
825
897
|
});
|
|
826
898
|
}
|
|
827
|
-
async updatePresentation(
|
|
828
|
-
isP2P:
|
|
829
|
-
maxBitrate:
|
|
830
|
-
degradationPreference:
|
|
899
|
+
async updatePresentation(e, {
|
|
900
|
+
isP2P: t = !1,
|
|
901
|
+
maxBitrate: s,
|
|
902
|
+
degradationPreference: r
|
|
831
903
|
} = {}) {
|
|
832
904
|
const o = this.establishedSession;
|
|
833
905
|
if (!o)
|
|
834
906
|
throw new Error("No session established");
|
|
835
907
|
if (!this._streamPresentationCurrent)
|
|
836
908
|
throw new Error("Presentation has not started yet");
|
|
837
|
-
return this.promisePendingStartPresentation && await this.promisePendingStartPresentation, this._sendPresentation(o,
|
|
838
|
-
isP2P:
|
|
839
|
-
maxBitrate:
|
|
840
|
-
degradationPreference:
|
|
909
|
+
return this.promisePendingStartPresentation && await this.promisePendingStartPresentation, this._sendPresentation(o, e, {
|
|
910
|
+
isP2P: t,
|
|
911
|
+
maxBitrate: s,
|
|
912
|
+
degradationPreference: r,
|
|
841
913
|
isNeedReinvite: !1
|
|
842
914
|
});
|
|
843
915
|
}
|
|
844
916
|
_resetPresentation() {
|
|
845
917
|
delete this._streamPresentationCurrent, this.promisePendingStartPresentation = void 0, this.promisePendingStopPresentation = void 0;
|
|
846
918
|
}
|
|
847
|
-
on(
|
|
848
|
-
return this._uaEvents.on(
|
|
919
|
+
on(e, t) {
|
|
920
|
+
return this._uaEvents.on(e, t);
|
|
849
921
|
}
|
|
850
|
-
once(
|
|
851
|
-
return this._uaEvents.once(
|
|
922
|
+
once(e, t) {
|
|
923
|
+
return this._uaEvents.once(e, t);
|
|
852
924
|
}
|
|
853
|
-
onceRace(
|
|
854
|
-
return this._uaEvents.onceRace(
|
|
925
|
+
onceRace(e, t) {
|
|
926
|
+
return this._uaEvents.onceRace(e, t);
|
|
855
927
|
}
|
|
856
|
-
async wait(
|
|
857
|
-
return this._uaEvents.wait(
|
|
928
|
+
async wait(e) {
|
|
929
|
+
return this._uaEvents.wait(e);
|
|
858
930
|
}
|
|
859
|
-
off(
|
|
860
|
-
this._uaEvents.off(
|
|
931
|
+
off(e, t) {
|
|
932
|
+
this._uaEvents.off(e, t);
|
|
861
933
|
}
|
|
862
|
-
onSession(
|
|
863
|
-
return this._sessionEvents.on(
|
|
934
|
+
onSession(e, t) {
|
|
935
|
+
return this._sessionEvents.on(e, t);
|
|
864
936
|
}
|
|
865
|
-
onceSession(
|
|
866
|
-
return this._sessionEvents.once(
|
|
937
|
+
onceSession(e, t) {
|
|
938
|
+
return this._sessionEvents.once(e, t);
|
|
867
939
|
}
|
|
868
|
-
onceRaceSession(
|
|
869
|
-
return this._sessionEvents.onceRace(
|
|
940
|
+
onceRaceSession(e, t) {
|
|
941
|
+
return this._sessionEvents.onceRace(e, t);
|
|
870
942
|
}
|
|
871
|
-
async waitSession(
|
|
872
|
-
return this._sessionEvents.wait(
|
|
943
|
+
async waitSession(e) {
|
|
944
|
+
return this._sessionEvents.wait(e);
|
|
873
945
|
}
|
|
874
|
-
offSession(
|
|
875
|
-
this._sessionEvents.off(
|
|
946
|
+
offSession(e, t) {
|
|
947
|
+
this._sessionEvents.off(e, t);
|
|
876
948
|
}
|
|
877
949
|
isConfigured() {
|
|
878
950
|
return !!this.ua;
|
|
@@ -883,18 +955,18 @@ class $l {
|
|
|
883
955
|
getRemoteStreams() {
|
|
884
956
|
if (!this.connection)
|
|
885
957
|
return;
|
|
886
|
-
const
|
|
887
|
-
return
|
|
958
|
+
const t = this.connection.getReceivers().map(({ track: s }) => s);
|
|
959
|
+
return $n(t) ? this._generateStreams(t) : this._generateAudioStreams(t);
|
|
888
960
|
}
|
|
889
961
|
get connection() {
|
|
890
|
-
var
|
|
891
|
-
return (
|
|
962
|
+
var t;
|
|
963
|
+
return (t = this.session) == null ? void 0 : t.connection;
|
|
892
964
|
}
|
|
893
965
|
get remoteCallerData() {
|
|
894
|
-
var t,
|
|
966
|
+
var e, t, s, r, o, i;
|
|
895
967
|
return {
|
|
896
|
-
displayName: (
|
|
897
|
-
host: (
|
|
968
|
+
displayName: (t = (e = this.incomingSession) == null ? void 0 : e.remote_identity) == null ? void 0 : t.display_name,
|
|
969
|
+
host: (r = (s = this.incomingSession) == null ? void 0 : s.remote_identity) == null ? void 0 : r.uri.host,
|
|
898
970
|
incomingNumber: (i = (o = this.incomingSession) == null ? void 0 : o.remote_identity) == null ? void 0 : i.uri.user,
|
|
899
971
|
session: this.incomingSession
|
|
900
972
|
};
|
|
@@ -918,33 +990,33 @@ class $l {
|
|
|
918
990
|
return !!this.incomingSession;
|
|
919
991
|
}
|
|
920
992
|
_init({
|
|
921
|
-
sipServerUrl:
|
|
922
|
-
sipWebSocketServerURL:
|
|
993
|
+
sipServerUrl: e,
|
|
994
|
+
sipWebSocketServerURL: t
|
|
923
995
|
}) {
|
|
924
|
-
this.getSipServerUrl =
|
|
996
|
+
this.getSipServerUrl = Vn(e), this.socket = new this.JsSIP.WebSocketInterface(t);
|
|
925
997
|
}
|
|
926
|
-
_generateStream(
|
|
927
|
-
const { id:
|
|
928
|
-
return
|
|
998
|
+
_generateStream(e, t) {
|
|
999
|
+
const { id: s } = e, r = this._remoteStreams[s] || new MediaStream();
|
|
1000
|
+
return t && r.addTrack(t), r.addTrack(e), this._remoteStreams[s] = r, r;
|
|
929
1001
|
}
|
|
930
|
-
_generateAudioStream(
|
|
931
|
-
const { id:
|
|
932
|
-
return
|
|
1002
|
+
_generateAudioStream(e) {
|
|
1003
|
+
const { id: t } = e, s = this._remoteStreams[t] || new MediaStream();
|
|
1004
|
+
return s.addTrack(e), this._remoteStreams[t] = s, s;
|
|
933
1005
|
}
|
|
934
|
-
_generateStreams(
|
|
935
|
-
const
|
|
936
|
-
return
|
|
937
|
-
if (
|
|
1006
|
+
_generateStreams(e) {
|
|
1007
|
+
const t = [];
|
|
1008
|
+
return e.forEach((s, r) => {
|
|
1009
|
+
if (s.kind === "audio")
|
|
938
1010
|
return;
|
|
939
|
-
const o =
|
|
940
|
-
let
|
|
941
|
-
i && i.kind === "audio" && (
|
|
942
|
-
const u = this._generateStream(o,
|
|
943
|
-
|
|
944
|
-
}),
|
|
1011
|
+
const o = s, i = e[r - 1];
|
|
1012
|
+
let c;
|
|
1013
|
+
i && i.kind === "audio" && (c = i);
|
|
1014
|
+
const u = this._generateStream(o, c);
|
|
1015
|
+
t.push(u);
|
|
1016
|
+
}), t;
|
|
945
1017
|
}
|
|
946
|
-
_generateAudioStreams(
|
|
947
|
-
return
|
|
1018
|
+
_generateAudioStreams(e) {
|
|
1019
|
+
return e.map((s) => this._generateAudioStream(s));
|
|
948
1020
|
}
|
|
949
1021
|
_cancelRequests() {
|
|
950
1022
|
this._cancelActionsRequests(), this._cancelCallRequests(), this._cancelConnectRequests();
|
|
@@ -959,885 +1031,420 @@ class $l {
|
|
|
959
1031
|
this._cancelableAnswer.cancelRequest(), this._cancelableSendDTMF.cancelRequest();
|
|
960
1032
|
}
|
|
961
1033
|
async waitChannels() {
|
|
962
|
-
return this.waitSession(
|
|
1034
|
+
return this.waitSession($);
|
|
963
1035
|
}
|
|
964
1036
|
async waitSyncMediaState() {
|
|
965
|
-
return this.waitSession(
|
|
1037
|
+
return this.waitSession(x);
|
|
966
1038
|
}
|
|
967
|
-
async sendChannels({ inputChannels:
|
|
1039
|
+
async sendChannels({ inputChannels: e, outputChannels: t }) {
|
|
968
1040
|
if (!this.session)
|
|
969
1041
|
throw new Error("No session established");
|
|
970
|
-
const
|
|
971
|
-
|
|
972
|
-
|
|
1042
|
+
const s = `${Xe}: ${e}`, r = `${ze}: ${t}`, o = [
|
|
1043
|
+
s,
|
|
1044
|
+
r
|
|
973
1045
|
];
|
|
974
|
-
return this.session.sendInfo(
|
|
1046
|
+
return this.session.sendInfo(Cn, void 0, { extraHeaders: o });
|
|
975
1047
|
}
|
|
976
|
-
async sendMediaState({ cam:
|
|
1048
|
+
async sendMediaState({ cam: e, mic: t }, s = {}) {
|
|
977
1049
|
if (!this.session)
|
|
978
1050
|
throw new Error("No session established");
|
|
979
|
-
const
|
|
980
|
-
|
|
1051
|
+
const r = `${On}: currentstate`, o = `${Dn}: ${Number(e)}`, i = `${pn}: ${Number(t)}`, c = [
|
|
1052
|
+
r,
|
|
981
1053
|
o,
|
|
982
1054
|
i
|
|
983
1055
|
];
|
|
984
|
-
return this.session.sendInfo(
|
|
1056
|
+
return this.session.sendInfo(gn, void 0, {
|
|
985
1057
|
noTerminateWhenError: !0,
|
|
986
|
-
...
|
|
987
|
-
extraHeaders:
|
|
1058
|
+
...s,
|
|
1059
|
+
extraHeaders: c
|
|
988
1060
|
});
|
|
989
1061
|
}
|
|
990
|
-
async _sendRefusalToTurnOn(
|
|
1062
|
+
async _sendRefusalToTurnOn(e, t = {}) {
|
|
991
1063
|
if (!this.session)
|
|
992
1064
|
throw new Error("No session established");
|
|
993
|
-
const
|
|
994
|
-
return this.session.sendInfo(
|
|
1065
|
+
const c = [`${Pn}: ${e === "mic" ? 0 : 1}`];
|
|
1066
|
+
return this.session.sendInfo(Nn, void 0, {
|
|
995
1067
|
noTerminateWhenError: !0,
|
|
996
|
-
...
|
|
997
|
-
extraHeaders:
|
|
1068
|
+
...t,
|
|
1069
|
+
extraHeaders: c
|
|
998
1070
|
});
|
|
999
1071
|
}
|
|
1000
|
-
async sendRefusalToTurnOnMic(
|
|
1072
|
+
async sendRefusalToTurnOnMic(e = {}) {
|
|
1001
1073
|
if (!this.session)
|
|
1002
1074
|
throw new Error("No session established");
|
|
1003
|
-
return this._sendRefusalToTurnOn("mic", { noTerminateWhenError: !0, ...
|
|
1075
|
+
return this._sendRefusalToTurnOn("mic", { noTerminateWhenError: !0, ...e });
|
|
1004
1076
|
}
|
|
1005
|
-
async sendRefusalToTurnOnCam(
|
|
1077
|
+
async sendRefusalToTurnOnCam(e = {}) {
|
|
1006
1078
|
if (!this.session)
|
|
1007
1079
|
throw new Error("No session established");
|
|
1008
|
-
return this._sendRefusalToTurnOn("cam", { noTerminateWhenError: !0, ...
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
const on = "purgatory", F = (e) => e === on, pe = (e) => () => (_("getRemoteStreams"), e.getRemoteStreams()), Cs = ({ kind: e, readyState: t }) => e === "video" && t === "live", an = (e) => ({ track: t }) => {
|
|
1012
|
-
Cs(t) && e();
|
|
1013
|
-
};
|
|
1014
|
-
var x = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1015
|
-
function be(e) {
|
|
1016
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1017
|
-
}
|
|
1018
|
-
function Rs(e) {
|
|
1019
|
-
var t = typeof e;
|
|
1020
|
-
return e != null && (t == "object" || t == "function");
|
|
1021
|
-
}
|
|
1022
|
-
var $ = Rs, Ns = typeof x == "object" && x && x.Object === Object && x, cn = Ns, vs = cn, As = typeof self == "object" && self && self.Object === Object && self, ps = vs || As || Function("return this")(), X = ps, bs = X, ys = function() {
|
|
1023
|
-
return bs.Date.now();
|
|
1024
|
-
}, Is = ys, Os = /\s/;
|
|
1025
|
-
function Ms(e) {
|
|
1026
|
-
for (var t = e.length; t-- && Os.test(e.charAt(t)); )
|
|
1027
|
-
;
|
|
1028
|
-
return t;
|
|
1029
|
-
}
|
|
1030
|
-
var Ps = Ms, Ds = Ps, ws = /^\s+/;
|
|
1031
|
-
function $s(e) {
|
|
1032
|
-
return e && e.slice(0, Ds(e) + 1).replace(ws, "");
|
|
1033
|
-
}
|
|
1034
|
-
var Ls = $s, Us = X, Fs = Us.Symbol, z = Fs, xe = z, un = Object.prototype, ks = un.hasOwnProperty, Bs = un.toString, L = xe ? xe.toStringTag : void 0;
|
|
1035
|
-
function xs(e) {
|
|
1036
|
-
var t = ks.call(e, L), n = e[L];
|
|
1037
|
-
try {
|
|
1038
|
-
e[L] = void 0;
|
|
1039
|
-
var r = !0;
|
|
1040
|
-
} catch {
|
|
1041
|
-
}
|
|
1042
|
-
var s = Bs.call(e);
|
|
1043
|
-
return r && (t ? e[L] = n : delete e[L]), s;
|
|
1044
|
-
}
|
|
1045
|
-
var Hs = xs, Ws = Object.prototype, Vs = Ws.toString;
|
|
1046
|
-
function js(e) {
|
|
1047
|
-
return Vs.call(e);
|
|
1048
|
-
}
|
|
1049
|
-
var qs = js, He = z, Gs = Hs, Ys = qs, Xs = "[object Null]", zs = "[object Undefined]", We = He ? He.toStringTag : void 0;
|
|
1050
|
-
function Js(e) {
|
|
1051
|
-
return e == null ? e === void 0 ? zs : Xs : We && We in Object(e) ? Gs(e) : Ys(e);
|
|
1052
|
-
}
|
|
1053
|
-
var J = Js;
|
|
1054
|
-
function Ks(e) {
|
|
1055
|
-
return e != null && typeof e == "object";
|
|
1056
|
-
}
|
|
1057
|
-
var B = Ks, Qs = J, Zs = B, eo = "[object Symbol]";
|
|
1058
|
-
function to(e) {
|
|
1059
|
-
return typeof e == "symbol" || Zs(e) && Qs(e) == eo;
|
|
1060
|
-
}
|
|
1061
|
-
var ln = to, no = Ls, Ve = $, ro = ln, je = 0 / 0, so = /^[-+]0x[0-9a-f]+$/i, oo = /^0b[01]+$/i, io = /^0o[0-7]+$/i, ao = parseInt;
|
|
1062
|
-
function co(e) {
|
|
1063
|
-
if (typeof e == "number")
|
|
1064
|
-
return e;
|
|
1065
|
-
if (ro(e))
|
|
1066
|
-
return je;
|
|
1067
|
-
if (Ve(e)) {
|
|
1068
|
-
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
1069
|
-
e = Ve(t) ? t + "" : t;
|
|
1070
|
-
}
|
|
1071
|
-
if (typeof e != "string")
|
|
1072
|
-
return e === 0 ? e : +e;
|
|
1073
|
-
e = no(e);
|
|
1074
|
-
var n = oo.test(e);
|
|
1075
|
-
return n || io.test(e) ? ao(e.slice(2), n ? 2 : 8) : so.test(e) ? je : +e;
|
|
1076
|
-
}
|
|
1077
|
-
var uo = co, lo = $, ee = Is, qe = uo, _o = "Expected a function", Eo = Math.max, ho = Math.min;
|
|
1078
|
-
function fo(e, t, n) {
|
|
1079
|
-
var r, s, o, i, a, u, l = 0, d = !1, E = !1, h = !0;
|
|
1080
|
-
if (typeof e != "function")
|
|
1081
|
-
throw new TypeError(_o);
|
|
1082
|
-
t = qe(t) || 0, lo(n) && (d = !!n.leading, E = "maxWait" in n, o = E ? Eo(qe(n.maxWait) || 0, t) : o, h = "trailing" in n ? !!n.trailing : h);
|
|
1083
|
-
function S(f) {
|
|
1084
|
-
var R = r, p = s;
|
|
1085
|
-
return r = s = void 0, l = f, i = e.apply(p, R), i;
|
|
1086
|
-
}
|
|
1087
|
-
function g(f) {
|
|
1088
|
-
return l = f, a = setTimeout(A, t), d ? S(f) : i;
|
|
1089
|
-
}
|
|
1090
|
-
function m(f) {
|
|
1091
|
-
var R = f - u, p = f - l, O = t - R;
|
|
1092
|
-
return E ? ho(O, o - p) : O;
|
|
1093
|
-
}
|
|
1094
|
-
function C(f) {
|
|
1095
|
-
var R = f - u, p = f - l;
|
|
1096
|
-
return u === void 0 || R >= t || R < 0 || E && p >= o;
|
|
1097
|
-
}
|
|
1098
|
-
function A() {
|
|
1099
|
-
var f = ee();
|
|
1100
|
-
if (C(f))
|
|
1101
|
-
return b(f);
|
|
1102
|
-
a = setTimeout(A, m(f));
|
|
1103
|
-
}
|
|
1104
|
-
function b(f) {
|
|
1105
|
-
return a = void 0, h && r ? S(f) : (r = s = void 0, i);
|
|
1106
|
-
}
|
|
1107
|
-
function N() {
|
|
1108
|
-
a !== void 0 && clearTimeout(a), l = 0, r = u = s = a = void 0;
|
|
1109
|
-
}
|
|
1110
|
-
function v() {
|
|
1111
|
-
return a === void 0 ? i : b(ee());
|
|
1112
|
-
}
|
|
1113
|
-
function y() {
|
|
1114
|
-
var f = ee(), R = C(f);
|
|
1115
|
-
if (r = arguments, s = this, u = f, R) {
|
|
1116
|
-
if (a === void 0)
|
|
1117
|
-
return g(u);
|
|
1118
|
-
if (E)
|
|
1119
|
-
return clearTimeout(a), a = setTimeout(A, t), S(u);
|
|
1120
|
-
}
|
|
1121
|
-
return a === void 0 && (a = setTimeout(A, t)), i;
|
|
1080
|
+
return this._sendRefusalToTurnOn("cam", { noTerminateWhenError: !0, ...e });
|
|
1122
1081
|
}
|
|
1123
|
-
return y.cancel = N, y.flush = v, y;
|
|
1124
1082
|
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1083
|
+
const Bt = "purgatory", k = (n) => n === Bt, We = (n) => () => (E("getRemoteStreams"), n.getRemoteStreams()), _s = ({ kind: n, readyState: e }) => n === "video" && e === "live", Ft = (n) => ({ track: e }) => {
|
|
1084
|
+
_s(e) && n();
|
|
1085
|
+
}, qe = ({
|
|
1086
|
+
getRemoteStreams: n,
|
|
1087
|
+
setRemoteStreams: e
|
|
1088
|
+
}) => Gt(() => {
|
|
1089
|
+
const t = n();
|
|
1090
|
+
E("remoteStreams", t), t && e(t);
|
|
1091
|
+
}, 200), ls = (n) => async (t) => {
|
|
1133
1092
|
const {
|
|
1134
|
-
mediaStream:
|
|
1135
|
-
extraHeaders:
|
|
1093
|
+
mediaStream: s,
|
|
1094
|
+
extraHeaders: r,
|
|
1136
1095
|
iceServers: o,
|
|
1137
1096
|
degradationPreference: i,
|
|
1138
|
-
setRemoteStreams:
|
|
1097
|
+
setRemoteStreams: c,
|
|
1139
1098
|
onBeforeProgressCall: u,
|
|
1140
|
-
onSuccessProgressCall:
|
|
1141
|
-
onEnterPurgatory:
|
|
1142
|
-
onEnterConference:
|
|
1143
|
-
onFailProgressCall:
|
|
1144
|
-
onFinishProgressCall:
|
|
1145
|
-
onEndedCall:
|
|
1146
|
-
} =
|
|
1147
|
-
setRemoteStreams:
|
|
1148
|
-
getRemoteStreams:
|
|
1149
|
-
}),
|
|
1150
|
-
|
|
1151
|
-
const
|
|
1152
|
-
mediaStream:
|
|
1153
|
-
extraHeaders:
|
|
1099
|
+
onSuccessProgressCall: _,
|
|
1100
|
+
onEnterPurgatory: l,
|
|
1101
|
+
onEnterConference: d,
|
|
1102
|
+
onFailProgressCall: S,
|
|
1103
|
+
onFinishProgressCall: h,
|
|
1104
|
+
onEndedCall: T
|
|
1105
|
+
} = t, g = qe({
|
|
1106
|
+
setRemoteStreams: c,
|
|
1107
|
+
getRemoteStreams: We(n)
|
|
1108
|
+
}), N = Ft(g);
|
|
1109
|
+
E("answerIncomingCall", t);
|
|
1110
|
+
const p = async () => n.answerToIncomingCall({
|
|
1111
|
+
mediaStream: s,
|
|
1112
|
+
extraHeaders: r,
|
|
1154
1113
|
iceServers: o,
|
|
1155
1114
|
degradationPreference: i,
|
|
1156
|
-
ontrack:
|
|
1157
|
-
}),
|
|
1158
|
-
const { remoteCallerData:
|
|
1159
|
-
return
|
|
1115
|
+
ontrack: N
|
|
1116
|
+
}), M = () => {
|
|
1117
|
+
const { remoteCallerData: C } = n;
|
|
1118
|
+
return C.incomingNumber;
|
|
1160
1119
|
};
|
|
1161
|
-
let
|
|
1162
|
-
const f = (() => (
|
|
1163
|
-
|
|
1120
|
+
let m = !1, R;
|
|
1121
|
+
const f = (() => (E("subscribeEnterConference: onEnterConference", d), l ?? d ? n.onSession("enterRoom", (C) => {
|
|
1122
|
+
E("enterRoom", { _room: C, isSuccessProgressCall: m }), R = C, k(R) ? l && l() : d && d({ isSuccessProgressCall: m });
|
|
1164
1123
|
}) : () => {
|
|
1165
|
-
}))(),
|
|
1166
|
-
f(),
|
|
1167
|
-
}),
|
|
1168
|
-
throw
|
|
1169
|
-
},
|
|
1170
|
-
|
|
1124
|
+
}))(), b = (C) => (E("onSuccess"), m = !0, g(), _ && _({ isPurgatory: k(R) }), n.onceRaceSession(["ended", "failed"], () => {
|
|
1125
|
+
f(), T && T();
|
|
1126
|
+
}), C), w = (C) => {
|
|
1127
|
+
throw E("onFail"), S && S(), f(), C;
|
|
1128
|
+
}, U = () => {
|
|
1129
|
+
E("onFinish"), h && h();
|
|
1171
1130
|
};
|
|
1172
|
-
if (
|
|
1173
|
-
const
|
|
1174
|
-
u(
|
|
1131
|
+
if (E("onBeforeProgressCall"), u) {
|
|
1132
|
+
const C = M();
|
|
1133
|
+
u(C);
|
|
1175
1134
|
}
|
|
1176
|
-
return
|
|
1177
|
-
},
|
|
1135
|
+
return p().then(b).catch(w).finally(U);
|
|
1136
|
+
}, ds = (n) => async (t) => {
|
|
1178
1137
|
const {
|
|
1179
|
-
conference:
|
|
1180
|
-
mediaStream:
|
|
1138
|
+
conference: s,
|
|
1139
|
+
mediaStream: r,
|
|
1181
1140
|
extraHeaders: o,
|
|
1182
1141
|
iceServers: i,
|
|
1183
|
-
degradationPreference:
|
|
1142
|
+
degradationPreference: c,
|
|
1184
1143
|
setRemoteStreams: u,
|
|
1185
|
-
onBeforeProgressCall:
|
|
1186
|
-
onSuccessProgressCall:
|
|
1187
|
-
onEnterPurgatory:
|
|
1188
|
-
onEnterConference:
|
|
1189
|
-
onFailProgressCall:
|
|
1190
|
-
onFinishProgressCall:
|
|
1191
|
-
onEndedCall:
|
|
1192
|
-
} =
|
|
1144
|
+
onBeforeProgressCall: _,
|
|
1145
|
+
onSuccessProgressCall: l,
|
|
1146
|
+
onEnterPurgatory: d,
|
|
1147
|
+
onEnterConference: S,
|
|
1148
|
+
onFailProgressCall: h,
|
|
1149
|
+
onFinishProgressCall: T,
|
|
1150
|
+
onEndedCall: g
|
|
1151
|
+
} = t, N = qe({
|
|
1193
1152
|
setRemoteStreams: u,
|
|
1194
|
-
getRemoteStreams:
|
|
1195
|
-
}),
|
|
1196
|
-
|
|
1197
|
-
const
|
|
1198
|
-
mediaStream:
|
|
1153
|
+
getRemoteStreams: We(n)
|
|
1154
|
+
}), p = Ft(N);
|
|
1155
|
+
E("callToServer", t);
|
|
1156
|
+
const M = async () => (E("startCall"), n.call({
|
|
1157
|
+
mediaStream: r,
|
|
1199
1158
|
extraHeaders: o,
|
|
1200
1159
|
iceServers: i,
|
|
1201
|
-
degradationPreference:
|
|
1202
|
-
number:
|
|
1203
|
-
ontrack:
|
|
1160
|
+
degradationPreference: c,
|
|
1161
|
+
number: s,
|
|
1162
|
+
ontrack: p
|
|
1204
1163
|
}));
|
|
1205
|
-
let
|
|
1206
|
-
const f = (() => (
|
|
1207
|
-
|
|
1164
|
+
let m = !1, R;
|
|
1165
|
+
const f = (() => (E("subscribeEnterConference: onEnterConference", S), d ?? S ? n.onSession("enterRoom", (C) => {
|
|
1166
|
+
E("enterRoom", { _room: C, isSuccessProgressCall: m }), R = C, k(R) ? d && d() : S && S({ isSuccessProgressCall: m });
|
|
1208
1167
|
}) : () => {
|
|
1209
|
-
}))(),
|
|
1210
|
-
f(),
|
|
1211
|
-
}),
|
|
1212
|
-
throw
|
|
1213
|
-
},
|
|
1214
|
-
|
|
1168
|
+
}))(), b = (C) => (E("onSuccess"), m = !0, N(), l && l({ isPurgatory: k(R) }), n.onceRaceSession(["ended", "failed"], () => {
|
|
1169
|
+
f(), g && g();
|
|
1170
|
+
}), C), w = (C) => {
|
|
1171
|
+
throw E("onFail"), h && h(), f(), C;
|
|
1172
|
+
}, U = () => {
|
|
1173
|
+
E("onFinish"), T && T();
|
|
1215
1174
|
};
|
|
1216
|
-
return
|
|
1217
|
-
},
|
|
1218
|
-
if (!
|
|
1219
|
-
throw
|
|
1175
|
+
return E("onBeforeProgressCall"), _ && _(s), M().then(b).catch(w).finally(U);
|
|
1176
|
+
}, Q = (n) => {
|
|
1177
|
+
if (!et(n))
|
|
1178
|
+
throw n;
|
|
1220
1179
|
return !1;
|
|
1221
|
-
},
|
|
1180
|
+
}, Ss = (n) => async (t) => {
|
|
1222
1181
|
const {
|
|
1223
|
-
userAgent:
|
|
1224
|
-
sipWebSocketServerURL:
|
|
1182
|
+
userAgent: s,
|
|
1183
|
+
sipWebSocketServerURL: r,
|
|
1225
1184
|
sipServerUrl: o,
|
|
1226
1185
|
remoteAddress: i,
|
|
1227
|
-
displayName:
|
|
1186
|
+
displayName: c,
|
|
1228
1187
|
name: u,
|
|
1229
|
-
password:
|
|
1230
|
-
isRegisteredUser:
|
|
1231
|
-
sdpSemantics:
|
|
1232
|
-
isDisconnectOnFail:
|
|
1233
|
-
} =
|
|
1234
|
-
return
|
|
1235
|
-
userAgent:
|
|
1236
|
-
sdpSemantics:
|
|
1237
|
-
sipWebSocketServerURL:
|
|
1188
|
+
password: _,
|
|
1189
|
+
isRegisteredUser: l,
|
|
1190
|
+
sdpSemantics: d,
|
|
1191
|
+
isDisconnectOnFail: S
|
|
1192
|
+
} = t;
|
|
1193
|
+
return E("connectToServer", t), n.connect({
|
|
1194
|
+
userAgent: s,
|
|
1195
|
+
sdpSemantics: d,
|
|
1196
|
+
sipWebSocketServerURL: r,
|
|
1238
1197
|
sipServerUrl: o,
|
|
1239
1198
|
remoteAddress: i,
|
|
1240
|
-
displayName:
|
|
1241
|
-
password:
|
|
1199
|
+
displayName: c,
|
|
1200
|
+
password: _,
|
|
1242
1201
|
user: u,
|
|
1243
|
-
register:
|
|
1244
|
-
}).then(() => (
|
|
1245
|
-
},
|
|
1246
|
-
const { url:
|
|
1247
|
-
let
|
|
1248
|
-
return (
|
|
1202
|
+
register: l
|
|
1203
|
+
}).then(() => (E("connectToServer then"), !0)).catch(async (h) => (E("connectToServer catch: error", h), S === !0 ? n.disconnect().then(() => Q(h)).catch(() => Q(h)) : Q(h)));
|
|
1204
|
+
}, hs = (n) => async () => (E("disconnectFromServer"), n.disconnect().then(() => (E("disconnectFromServer: then"), !1)).catch((e) => (E("disconnectFromServer: catch", e), !1))), $e = (n) => {
|
|
1205
|
+
const { url: e, cause: t } = n;
|
|
1206
|
+
let s = e;
|
|
1207
|
+
return (t === re || t === se) && (s = `${n.message.to.uri.user}@${n.message.to.uri.host}`), s;
|
|
1249
1208
|
};
|
|
1250
|
-
var
|
|
1251
|
-
const
|
|
1252
|
-
var
|
|
1253
|
-
const { cause:
|
|
1254
|
-
let
|
|
1255
|
-
switch (
|
|
1209
|
+
var kt = /* @__PURE__ */ ((n) => (n.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", n.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", n.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", n.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", n.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", n.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", n))(kt || {});
|
|
1210
|
+
const Ts = (n = new Error()) => {
|
|
1211
|
+
var r;
|
|
1212
|
+
const { cause: e, socket: t } = n;
|
|
1213
|
+
let s = "CONNECT_SERVER_FAILED";
|
|
1214
|
+
switch (e) {
|
|
1256
1215
|
case "Forbidden": {
|
|
1257
|
-
|
|
1216
|
+
s = "WRONG_USER_OR_PASSWORD";
|
|
1258
1217
|
break;
|
|
1259
1218
|
}
|
|
1260
|
-
case
|
|
1261
|
-
|
|
1219
|
+
case re: {
|
|
1220
|
+
s = "BAD_MEDIA_ERROR";
|
|
1262
1221
|
break;
|
|
1263
1222
|
}
|
|
1264
|
-
case
|
|
1265
|
-
|
|
1223
|
+
case se: {
|
|
1224
|
+
s = "NOT_FOUND_ERROR";
|
|
1266
1225
|
break;
|
|
1267
1226
|
}
|
|
1268
1227
|
default:
|
|
1269
|
-
|
|
1228
|
+
t && ((r = t == null ? void 0 : t._ws) == null ? void 0 : r.readyState) === 3 ? s = "WS_CONNECTION_FAILED" : $e(n) && (s = "CONNECT_SERVER_FAILED_BY_LINK");
|
|
1270
1229
|
}
|
|
1271
|
-
return
|
|
1272
|
-
},
|
|
1273
|
-
const { code:
|
|
1274
|
-
return
|
|
1275
|
-
},
|
|
1230
|
+
return s;
|
|
1231
|
+
}, Cs = (n = new Error()) => {
|
|
1232
|
+
const { code: e, cause: t, message: s } = n, r = $e(n), o = {};
|
|
1233
|
+
return s && (o.message = s), r && (o.link = r), e && (o.code = e), t && (o.cause = t), o;
|
|
1234
|
+
}, gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1276
1235
|
__proto__: null,
|
|
1277
|
-
EErrorTypes:
|
|
1278
|
-
getLinkError:
|
|
1279
|
-
getTypeFromError:
|
|
1280
|
-
getValuesFromError:
|
|
1281
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1282
|
-
sessionId:
|
|
1283
|
-
remoteAddress:
|
|
1284
|
-
isMutedAudio:
|
|
1285
|
-
isMutedVideo:
|
|
1286
|
-
isRegistered:
|
|
1236
|
+
EErrorTypes: kt,
|
|
1237
|
+
getLinkError: $e,
|
|
1238
|
+
getTypeFromError: Ts,
|
|
1239
|
+
getValuesFromError: Cs
|
|
1240
|
+
}, Symbol.toStringTag, { value: "Module" })), Ns = ({
|
|
1241
|
+
sessionId: n,
|
|
1242
|
+
remoteAddress: e,
|
|
1243
|
+
isMutedAudio: t,
|
|
1244
|
+
isMutedVideo: s,
|
|
1245
|
+
isRegistered: r,
|
|
1287
1246
|
isPresentationCall: o
|
|
1288
1247
|
}) => {
|
|
1289
|
-
const i = [],
|
|
1290
|
-
return i.push(`X-Vinteo-Mic-State: ${
|
|
1291
|
-
},
|
|
1292
|
-
appName:
|
|
1293
|
-
appVersion:
|
|
1294
|
-
browserName:
|
|
1295
|
-
browserVersion:
|
|
1248
|
+
const i = [], c = t ? "0" : "1", u = s ? "0" : "1";
|
|
1249
|
+
return i.push(`X-Vinteo-Mic-State: ${c}`, `X-Vinteo-MainCam-State: ${u}`), r || i.push("X-Vinteo-Purgatory-Call: yes"), n && i.push(`X-Vinteo-Session: ${n}`), o && i.push("X-Vinteo-Presentation-Call: yes"), e && i.push(`X-Vinteo-Remote: ${e}`), i;
|
|
1250
|
+
}, ms = ({
|
|
1251
|
+
appName: n,
|
|
1252
|
+
appVersion: e,
|
|
1253
|
+
browserName: t,
|
|
1254
|
+
browserVersion: s
|
|
1296
1255
|
}) => {
|
|
1297
|
-
const
|
|
1298
|
-
return `ChromeNew - ${
|
|
1299
|
-
},
|
|
1300
|
-
isUnifiedSdpSemantic:
|
|
1301
|
-
appVersion:
|
|
1302
|
-
browserName:
|
|
1303
|
-
browserVersion:
|
|
1304
|
-
appName:
|
|
1305
|
-
}) =>
|
|
1306
|
-
if (
|
|
1307
|
-
return
|
|
1308
|
-
},
|
|
1309
|
-
isEnabledCam:
|
|
1310
|
-
isEnabledMic:
|
|
1256
|
+
const r = `${n} ${e}`;
|
|
1257
|
+
return `ChromeNew - ${t ? `${t} ${s}, ${r}` : r}`;
|
|
1258
|
+
}, Rs = ({
|
|
1259
|
+
isUnifiedSdpSemantic: n,
|
|
1260
|
+
appVersion: e,
|
|
1261
|
+
browserName: t,
|
|
1262
|
+
browserVersion: s,
|
|
1263
|
+
appName: r
|
|
1264
|
+
}) => n ? ms({ appVersion: e, browserName: t, browserVersion: s, appName: r }) : "Chrome", As = (n) => async () => {
|
|
1265
|
+
if (n.isCallActive)
|
|
1266
|
+
return E("askPermissionToEnableCam"), n.askPermissionToEnableCam();
|
|
1267
|
+
}, fs = (n) => (t) => (E("onMustStopPresentation"), n.onSession("mustStopPresentation", t)), Is = (n) => (t) => (E("onUseLicense"), n.onSession("useLicense", t)), Ms = (n) => async ({
|
|
1268
|
+
isEnabledCam: t,
|
|
1269
|
+
isEnabledMic: s
|
|
1311
1270
|
}) => {
|
|
1312
|
-
if (
|
|
1313
|
-
return
|
|
1314
|
-
},
|
|
1315
|
-
if (
|
|
1316
|
-
return
|
|
1317
|
-
|
|
1271
|
+
if (n.isCallActive)
|
|
1272
|
+
return E("sendMediaState"), n.sendMediaState({ cam: t, mic: s });
|
|
1273
|
+
}, Os = (n) => async () => {
|
|
1274
|
+
if (n.isCallActive)
|
|
1275
|
+
return E("sendRefusalToTurnOnCam"), n.sendRefusalToTurnOnCam().catch((t) => {
|
|
1276
|
+
E("sendRefusalToTurnOnCam: error", t);
|
|
1318
1277
|
});
|
|
1319
|
-
},
|
|
1320
|
-
if (
|
|
1321
|
-
return
|
|
1322
|
-
|
|
1278
|
+
}, Ps = (n) => async () => {
|
|
1279
|
+
if (n.isCallActive)
|
|
1280
|
+
return E("sendRefusalToTurnOnMic"), n.sendRefusalToTurnOnMic().catch((t) => {
|
|
1281
|
+
E("sendRefusalToTurnOnMic: error", t);
|
|
1323
1282
|
});
|
|
1324
|
-
},
|
|
1325
|
-
maxBitrate:
|
|
1326
|
-
sipConnector:
|
|
1283
|
+
}, Ds = 1e6, ps = ({
|
|
1284
|
+
maxBitrate: n = Ds,
|
|
1285
|
+
sipConnector: e
|
|
1327
1286
|
}) => async ({
|
|
1328
|
-
mediaStream:
|
|
1329
|
-
isP2P:
|
|
1330
|
-
}) => (
|
|
1331
|
-
isP2P:
|
|
1332
|
-
maxBitrate:
|
|
1333
|
-
})),
|
|
1334
|
-
isP2P:
|
|
1335
|
-
}).catch(
|
|
1336
|
-
sipConnector:
|
|
1337
|
-
maxBitrate:
|
|
1287
|
+
mediaStream: s,
|
|
1288
|
+
isP2P: r = !1
|
|
1289
|
+
}) => (E("startPresentation"), e.startPresentation(s, {
|
|
1290
|
+
isP2P: r,
|
|
1291
|
+
maxBitrate: n
|
|
1292
|
+
})), vs = ({ sipConnector: n }) => async ({ isP2P: t = !1 } = {}) => (E("stopShareSipConnector"), n.stopPresentation({
|
|
1293
|
+
isP2P: t
|
|
1294
|
+
}).catch(E)), ys = 1e6, bs = ({
|
|
1295
|
+
sipConnector: n,
|
|
1296
|
+
maxBitrate: e = ys
|
|
1338
1297
|
}) => async ({
|
|
1339
|
-
mediaStream:
|
|
1340
|
-
isP2P:
|
|
1341
|
-
}) => (
|
|
1342
|
-
isP2P:
|
|
1343
|
-
maxBitrate:
|
|
1344
|
-
}))
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
return function(t) {
|
|
1349
|
-
if (!Bo(t))
|
|
1350
|
-
return {};
|
|
1351
|
-
if (Ge)
|
|
1352
|
-
return Ge(t);
|
|
1353
|
-
e.prototype = t;
|
|
1354
|
-
var n = new e();
|
|
1355
|
-
return e.prototype = void 0, n;
|
|
1356
|
-
};
|
|
1357
|
-
}(), dn = xo;
|
|
1358
|
-
function Ho() {
|
|
1359
|
-
}
|
|
1360
|
-
var Oe = Ho, Wo = dn, Vo = Oe;
|
|
1361
|
-
function j(e, t) {
|
|
1362
|
-
this.__wrapped__ = e, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this.__values__ = void 0;
|
|
1363
|
-
}
|
|
1364
|
-
j.prototype = Wo(Vo.prototype);
|
|
1365
|
-
j.prototype.constructor = j;
|
|
1366
|
-
var Me = j;
|
|
1367
|
-
function jo(e, t) {
|
|
1368
|
-
for (var n = -1, r = t.length, s = e.length; ++n < r; )
|
|
1369
|
-
e[s + n] = t[n];
|
|
1370
|
-
return e;
|
|
1371
|
-
}
|
|
1372
|
-
var qo = jo, Go = J, Yo = B, Xo = "[object Arguments]";
|
|
1373
|
-
function zo(e) {
|
|
1374
|
-
return Yo(e) && Go(e) == Xo;
|
|
1375
|
-
}
|
|
1376
|
-
var Jo = zo, Ye = Jo, Ko = B, En = Object.prototype, Qo = En.hasOwnProperty, Zo = En.propertyIsEnumerable, ei = Ye(function() {
|
|
1377
|
-
return arguments;
|
|
1378
|
-
}()) ? Ye : function(e) {
|
|
1379
|
-
return Ko(e) && Qo.call(e, "callee") && !Zo.call(e, "callee");
|
|
1380
|
-
}, ti = ei, ni = Array.isArray, K = ni, Xe = z, ri = ti, si = K, ze = Xe ? Xe.isConcatSpreadable : void 0;
|
|
1381
|
-
function oi(e) {
|
|
1382
|
-
return si(e) || ri(e) || !!(ze && e && e[ze]);
|
|
1383
|
-
}
|
|
1384
|
-
var ii = oi, ai = qo, ci = ii;
|
|
1385
|
-
function hn(e, t, n, r, s) {
|
|
1386
|
-
var o = -1, i = e.length;
|
|
1387
|
-
for (n || (n = ci), s || (s = []); ++o < i; ) {
|
|
1388
|
-
var a = e[o];
|
|
1389
|
-
t > 0 && n(a) ? t > 1 ? hn(a, t - 1, n, r, s) : ai(s, a) : r || (s[s.length] = a);
|
|
1390
|
-
}
|
|
1391
|
-
return s;
|
|
1392
|
-
}
|
|
1393
|
-
var ui = hn, li = ui;
|
|
1394
|
-
function _i(e) {
|
|
1395
|
-
var t = e == null ? 0 : e.length;
|
|
1396
|
-
return t ? li(e, 1) : [];
|
|
1397
|
-
}
|
|
1398
|
-
var di = _i;
|
|
1399
|
-
function Ei(e, t, n) {
|
|
1400
|
-
switch (n.length) {
|
|
1401
|
-
case 0:
|
|
1402
|
-
return e.call(t);
|
|
1403
|
-
case 1:
|
|
1404
|
-
return e.call(t, n[0]);
|
|
1405
|
-
case 2:
|
|
1406
|
-
return e.call(t, n[0], n[1]);
|
|
1407
|
-
case 3:
|
|
1408
|
-
return e.call(t, n[0], n[1], n[2]);
|
|
1409
|
-
}
|
|
1410
|
-
return e.apply(t, n);
|
|
1411
|
-
}
|
|
1412
|
-
var hi = Ei, fi = hi, Je = Math.max;
|
|
1413
|
-
function Si(e, t, n) {
|
|
1414
|
-
return t = Je(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
1415
|
-
for (var r = arguments, s = -1, o = Je(r.length - t, 0), i = Array(o); ++s < o; )
|
|
1416
|
-
i[s] = r[t + s];
|
|
1417
|
-
s = -1;
|
|
1418
|
-
for (var a = Array(t + 1); ++s < t; )
|
|
1419
|
-
a[s] = r[s];
|
|
1420
|
-
return a[t] = n(i), fi(e, this, a);
|
|
1421
|
-
};
|
|
1422
|
-
}
|
|
1423
|
-
var gi = Si;
|
|
1424
|
-
function Ti(e) {
|
|
1425
|
-
return function() {
|
|
1426
|
-
return e;
|
|
1427
|
-
};
|
|
1428
|
-
}
|
|
1429
|
-
var mi = Ti, Ci = J, Ri = $, Ni = "[object AsyncFunction]", vi = "[object Function]", Ai = "[object GeneratorFunction]", pi = "[object Proxy]";
|
|
1430
|
-
function bi(e) {
|
|
1431
|
-
if (!Ri(e))
|
|
1432
|
-
return !1;
|
|
1433
|
-
var t = Ci(e);
|
|
1434
|
-
return t == vi || t == Ai || t == Ni || t == pi;
|
|
1435
|
-
}
|
|
1436
|
-
var fn = bi, yi = X, Ii = yi["__core-js_shared__"], Oi = Ii, ne = Oi, Ke = function() {
|
|
1437
|
-
var e = /[^.]+$/.exec(ne && ne.keys && ne.keys.IE_PROTO || "");
|
|
1438
|
-
return e ? "Symbol(src)_1." + e : "";
|
|
1439
|
-
}();
|
|
1440
|
-
function Mi(e) {
|
|
1441
|
-
return !!Ke && Ke in e;
|
|
1442
|
-
}
|
|
1443
|
-
var Pi = Mi, Di = Function.prototype, wi = Di.toString;
|
|
1444
|
-
function $i(e) {
|
|
1445
|
-
if (e != null) {
|
|
1446
|
-
try {
|
|
1447
|
-
return wi.call(e);
|
|
1448
|
-
} catch {
|
|
1449
|
-
}
|
|
1450
|
-
try {
|
|
1451
|
-
return e + "";
|
|
1452
|
-
} catch {
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
return "";
|
|
1456
|
-
}
|
|
1457
|
-
var Li = $i, Ui = fn, Fi = Pi, ki = $, Bi = Li, xi = /[\\^$.*+?()[\]{}|]/g, Hi = /^\[object .+?Constructor\]$/, Wi = Function.prototype, Vi = Object.prototype, ji = Wi.toString, qi = Vi.hasOwnProperty, Gi = RegExp(
|
|
1458
|
-
"^" + ji.call(qi).replace(xi, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1459
|
-
);
|
|
1460
|
-
function Yi(e) {
|
|
1461
|
-
if (!ki(e) || Fi(e))
|
|
1462
|
-
return !1;
|
|
1463
|
-
var t = Ui(e) ? Gi : Hi;
|
|
1464
|
-
return t.test(Bi(e));
|
|
1465
|
-
}
|
|
1466
|
-
var Xi = Yi;
|
|
1467
|
-
function zi(e, t) {
|
|
1468
|
-
return e == null ? void 0 : e[t];
|
|
1469
|
-
}
|
|
1470
|
-
var Ji = zi, Ki = Xi, Qi = Ji;
|
|
1471
|
-
function Zi(e, t) {
|
|
1472
|
-
var n = Qi(e, t);
|
|
1473
|
-
return Ki(n) ? n : void 0;
|
|
1474
|
-
}
|
|
1475
|
-
var Sn = Zi, ea = Sn, ta = function() {
|
|
1476
|
-
try {
|
|
1477
|
-
var e = ea(Object, "defineProperty");
|
|
1478
|
-
return e({}, "", {}), e;
|
|
1479
|
-
} catch {
|
|
1480
|
-
}
|
|
1481
|
-
}(), na = ta;
|
|
1482
|
-
function ra(e) {
|
|
1483
|
-
return e;
|
|
1484
|
-
}
|
|
1485
|
-
var sa = ra, oa = mi, Qe = na, ia = sa, aa = Qe ? function(e, t) {
|
|
1486
|
-
return Qe(e, "toString", {
|
|
1487
|
-
configurable: !0,
|
|
1488
|
-
enumerable: !1,
|
|
1489
|
-
value: oa(t),
|
|
1490
|
-
writable: !0
|
|
1491
|
-
});
|
|
1492
|
-
} : ia, ca = aa, ua = 800, la = 16, _a = Date.now;
|
|
1493
|
-
function da(e) {
|
|
1494
|
-
var t = 0, n = 0;
|
|
1495
|
-
return function() {
|
|
1496
|
-
var r = _a(), s = la - (r - n);
|
|
1497
|
-
if (n = r, s > 0) {
|
|
1498
|
-
if (++t >= ua)
|
|
1499
|
-
return arguments[0];
|
|
1500
|
-
} else
|
|
1501
|
-
t = 0;
|
|
1502
|
-
return e.apply(void 0, arguments);
|
|
1503
|
-
};
|
|
1504
|
-
}
|
|
1505
|
-
var Ea = da, ha = ca, fa = Ea, Sa = fa(ha), ga = Sa, Ta = di, ma = gi, Ca = ga;
|
|
1506
|
-
function Ra(e) {
|
|
1507
|
-
return Ca(ma(e, void 0, Ta), e + "");
|
|
1508
|
-
}
|
|
1509
|
-
var Na = Ra, va = Sn, Aa = X, pa = va(Aa, "WeakMap"), ba = pa, Ze = ba, ya = Ze && new Ze(), Ia = ya;
|
|
1510
|
-
function Oa() {
|
|
1511
|
-
}
|
|
1512
|
-
var Ma = Oa, et = Ia, Pa = Ma, Da = et ? function(e) {
|
|
1513
|
-
return et.get(e);
|
|
1514
|
-
} : Pa, gn = Da, wa = {}, $a = wa, tt = $a, La = Object.prototype, Ua = La.hasOwnProperty;
|
|
1515
|
-
function Fa(e) {
|
|
1516
|
-
for (var t = e.name + "", n = tt[t], r = Ua.call(tt, t) ? n.length : 0; r--; ) {
|
|
1517
|
-
var s = n[r], o = s.func;
|
|
1518
|
-
if (o == null || o == e)
|
|
1519
|
-
return s.name;
|
|
1520
|
-
}
|
|
1521
|
-
return t;
|
|
1522
|
-
}
|
|
1523
|
-
var Tn = Fa, ka = dn, Ba = Oe, xa = 4294967295;
|
|
1524
|
-
function q(e) {
|
|
1525
|
-
this.__wrapped__ = e, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = xa, this.__views__ = [];
|
|
1526
|
-
}
|
|
1527
|
-
q.prototype = ka(Ba.prototype);
|
|
1528
|
-
q.prototype.constructor = q;
|
|
1529
|
-
var Pe = q;
|
|
1530
|
-
function Ha(e, t) {
|
|
1531
|
-
var n = -1, r = e.length;
|
|
1532
|
-
for (t || (t = Array(r)); ++n < r; )
|
|
1533
|
-
t[n] = e[n];
|
|
1534
|
-
return t;
|
|
1535
|
-
}
|
|
1536
|
-
var Wa = Ha, Va = Pe, ja = Me, qa = Wa;
|
|
1537
|
-
function Ga(e) {
|
|
1538
|
-
if (e instanceof Va)
|
|
1539
|
-
return e.clone();
|
|
1540
|
-
var t = new ja(e.__wrapped__, e.__chain__);
|
|
1541
|
-
return t.__actions__ = qa(e.__actions__), t.__index__ = e.__index__, t.__values__ = e.__values__, t;
|
|
1542
|
-
}
|
|
1543
|
-
var Ya = Ga, Xa = Pe, nt = Me, za = Oe, Ja = K, Ka = B, Qa = Ya, Za = Object.prototype, ec = Za.hasOwnProperty;
|
|
1544
|
-
function G(e) {
|
|
1545
|
-
if (Ka(e) && !Ja(e) && !(e instanceof Xa)) {
|
|
1546
|
-
if (e instanceof nt)
|
|
1547
|
-
return e;
|
|
1548
|
-
if (ec.call(e, "__wrapped__"))
|
|
1549
|
-
return Qa(e);
|
|
1550
|
-
}
|
|
1551
|
-
return new nt(e);
|
|
1552
|
-
}
|
|
1553
|
-
G.prototype = za.prototype;
|
|
1554
|
-
G.prototype.constructor = G;
|
|
1555
|
-
var tc = G, nc = Pe, rc = gn, sc = Tn, oc = tc;
|
|
1556
|
-
function ic(e) {
|
|
1557
|
-
var t = sc(e), n = oc[t];
|
|
1558
|
-
if (typeof n != "function" || !(t in nc.prototype))
|
|
1559
|
-
return !1;
|
|
1560
|
-
if (e === n)
|
|
1561
|
-
return !0;
|
|
1562
|
-
var r = rc(n);
|
|
1563
|
-
return !!r && e === r[0];
|
|
1564
|
-
}
|
|
1565
|
-
var ac = ic, rt = Me, cc = Na, uc = gn, re = Tn, lc = K, st = ac, _c = "Expected a function", dc = 8, Ec = 32, hc = 128, fc = 256;
|
|
1566
|
-
function Sc(e) {
|
|
1567
|
-
return cc(function(t) {
|
|
1568
|
-
var n = t.length, r = n, s = rt.prototype.thru;
|
|
1569
|
-
for (e && t.reverse(); r--; ) {
|
|
1570
|
-
var o = t[r];
|
|
1571
|
-
if (typeof o != "function")
|
|
1572
|
-
throw new TypeError(_c);
|
|
1573
|
-
if (s && !i && re(o) == "wrapper")
|
|
1574
|
-
var i = new rt([], !0);
|
|
1575
|
-
}
|
|
1576
|
-
for (r = i ? r : n; ++r < n; ) {
|
|
1577
|
-
o = t[r];
|
|
1578
|
-
var a = re(o), u = a == "wrapper" ? uc(o) : void 0;
|
|
1579
|
-
u && st(u[0]) && u[1] == (hc | dc | Ec | fc) && !u[4].length && u[9] == 1 ? i = i[re(u[0])].apply(i, u[3]) : i = o.length == 1 && st(o) ? i[a]() : i.thru(o);
|
|
1580
|
-
}
|
|
1581
|
-
return function() {
|
|
1582
|
-
var l = arguments, d = l[0];
|
|
1583
|
-
if (i && l.length == 1 && lc(d))
|
|
1584
|
-
return i.plant(d).value();
|
|
1585
|
-
for (var E = 0, h = n ? t[E].apply(this, l) : d; ++E < n; )
|
|
1586
|
-
h = t[E].call(this, h);
|
|
1587
|
-
return h;
|
|
1588
|
-
};
|
|
1589
|
-
});
|
|
1590
|
-
}
|
|
1591
|
-
var gc = Sc, Tc = gc, mc = Tc(), Cc = mc;
|
|
1592
|
-
const Rc = /* @__PURE__ */ be(Cc);
|
|
1593
|
-
function Nc(e, t) {
|
|
1594
|
-
for (var n = -1, r = e == null ? 0 : e.length, s = Array(r); ++n < r; )
|
|
1595
|
-
s[n] = t(e[n], n, e);
|
|
1596
|
-
return s;
|
|
1597
|
-
}
|
|
1598
|
-
var vc = Nc, ot = z, Ac = vc, pc = K, bc = ln, yc = 1 / 0, it = ot ? ot.prototype : void 0, at = it ? it.toString : void 0;
|
|
1599
|
-
function mn(e) {
|
|
1600
|
-
if (typeof e == "string")
|
|
1601
|
-
return e;
|
|
1602
|
-
if (pc(e))
|
|
1603
|
-
return Ac(e, mn) + "";
|
|
1604
|
-
if (bc(e))
|
|
1605
|
-
return at ? at.call(e) : "";
|
|
1606
|
-
var t = e + "";
|
|
1607
|
-
return t == "0" && 1 / e == -yc ? "-0" : t;
|
|
1608
|
-
}
|
|
1609
|
-
var Cn = mn;
|
|
1610
|
-
function Ic(e, t, n) {
|
|
1611
|
-
var r = -1, s = e.length;
|
|
1612
|
-
t < 0 && (t = -t > s ? 0 : s + t), n = n > s ? s : n, n < 0 && (n += s), s = t > n ? 0 : n - t >>> 0, t >>>= 0;
|
|
1613
|
-
for (var o = Array(s); ++r < s; )
|
|
1614
|
-
o[r] = e[r + t];
|
|
1615
|
-
return o;
|
|
1616
|
-
}
|
|
1617
|
-
var Oc = Ic, Mc = Oc;
|
|
1618
|
-
function Pc(e, t, n) {
|
|
1619
|
-
var r = e.length;
|
|
1620
|
-
return n = n === void 0 ? r : n, !t && n >= r ? e : Mc(e, t, n);
|
|
1621
|
-
}
|
|
1622
|
-
var Dc = Pc, wc = "\\ud800-\\udfff", $c = "\\u0300-\\u036f", Lc = "\\ufe20-\\ufe2f", Uc = "\\u20d0-\\u20ff", Fc = $c + Lc + Uc, kc = "\\ufe0e\\ufe0f", Bc = "\\u200d", xc = RegExp("[" + Bc + wc + Fc + kc + "]");
|
|
1623
|
-
function Hc(e) {
|
|
1624
|
-
return xc.test(e);
|
|
1625
|
-
}
|
|
1626
|
-
var Rn = Hc;
|
|
1627
|
-
function Wc(e, t) {
|
|
1628
|
-
return e === t || e !== e && t !== t;
|
|
1629
|
-
}
|
|
1630
|
-
var Vc = Wc, jc = 9007199254740991;
|
|
1631
|
-
function qc(e) {
|
|
1632
|
-
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= jc;
|
|
1633
|
-
}
|
|
1634
|
-
var Gc = qc, Yc = fn, Xc = Gc;
|
|
1635
|
-
function zc(e) {
|
|
1636
|
-
return e != null && Xc(e.length) && !Yc(e);
|
|
1637
|
-
}
|
|
1638
|
-
var Jc = zc, Kc = 9007199254740991, Qc = /^(?:0|[1-9]\d*)$/;
|
|
1639
|
-
function Zc(e, t) {
|
|
1640
|
-
var n = typeof e;
|
|
1641
|
-
return t = t ?? Kc, !!t && (n == "number" || n != "symbol" && Qc.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
1642
|
-
}
|
|
1643
|
-
var eu = Zc, tu = Vc, nu = Jc, ru = eu, su = $;
|
|
1644
|
-
function ou(e, t, n) {
|
|
1645
|
-
if (!su(n))
|
|
1646
|
-
return !1;
|
|
1647
|
-
var r = typeof t;
|
|
1648
|
-
return (r == "number" ? nu(n) && ru(t, n.length) : r == "string" && t in n) ? tu(n[t], e) : !1;
|
|
1649
|
-
}
|
|
1650
|
-
var iu = ou, au = J, cu = B, uu = "[object RegExp]";
|
|
1651
|
-
function lu(e) {
|
|
1652
|
-
return cu(e) && au(e) == uu;
|
|
1653
|
-
}
|
|
1654
|
-
var _u = lu;
|
|
1655
|
-
function du(e) {
|
|
1656
|
-
return function(t) {
|
|
1657
|
-
return e(t);
|
|
1658
|
-
};
|
|
1659
|
-
}
|
|
1660
|
-
var Eu = du, Y = { exports: {} };
|
|
1661
|
-
Y.exports;
|
|
1662
|
-
(function(e, t) {
|
|
1663
|
-
var n = cn, r = t && !t.nodeType && t, s = r && !0 && e && !e.nodeType && e, o = s && s.exports === r, i = o && n.process, a = function() {
|
|
1664
|
-
try {
|
|
1665
|
-
var u = s && s.require && s.require("util").types;
|
|
1666
|
-
return u || i && i.binding && i.binding("util");
|
|
1667
|
-
} catch {
|
|
1668
|
-
}
|
|
1669
|
-
}();
|
|
1670
|
-
e.exports = a;
|
|
1671
|
-
})(Y, Y.exports);
|
|
1672
|
-
var hu = Y.exports, fu = _u, Su = Eu, ct = hu, ut = ct && ct.isRegExp, gu = ut ? Su(ut) : fu, Tu = gu;
|
|
1673
|
-
function mu(e) {
|
|
1674
|
-
return e.split("");
|
|
1675
|
-
}
|
|
1676
|
-
var Cu = mu, Nn = "\\ud800-\\udfff", Ru = "\\u0300-\\u036f", Nu = "\\ufe20-\\ufe2f", vu = "\\u20d0-\\u20ff", Au = Ru + Nu + vu, pu = "\\ufe0e\\ufe0f", bu = "[" + Nn + "]", Se = "[" + Au + "]", ge = "\\ud83c[\\udffb-\\udfff]", yu = "(?:" + Se + "|" + ge + ")", vn = "[^" + Nn + "]", An = "(?:\\ud83c[\\udde6-\\uddff]){2}", pn = "[\\ud800-\\udbff][\\udc00-\\udfff]", Iu = "\\u200d", bn = yu + "?", yn = "[" + pu + "]?", Ou = "(?:" + Iu + "(?:" + [vn, An, pn].join("|") + ")" + yn + bn + ")*", Mu = yn + bn + Ou, Pu = "(?:" + [vn + Se + "?", Se, An, pn, bu].join("|") + ")", Du = RegExp(ge + "(?=" + ge + ")|" + Pu + Mu, "g");
|
|
1677
|
-
function wu(e) {
|
|
1678
|
-
return e.match(Du) || [];
|
|
1679
|
-
}
|
|
1680
|
-
var $u = wu, Lu = Cu, Uu = Rn, Fu = $u;
|
|
1681
|
-
function ku(e) {
|
|
1682
|
-
return Uu(e) ? Fu(e) : Lu(e);
|
|
1683
|
-
}
|
|
1684
|
-
var Bu = ku, xu = Cn;
|
|
1685
|
-
function Hu(e) {
|
|
1686
|
-
return e == null ? "" : xu(e);
|
|
1687
|
-
}
|
|
1688
|
-
var Wu = Hu, Vu = Cn, ju = Dc, qu = Rn, Gu = iu, Yu = Tu, Xu = Bu, zu = Wu, Ju = 4294967295;
|
|
1689
|
-
function Ku(e, t, n) {
|
|
1690
|
-
return n && typeof n != "number" && Gu(e, t, n) && (t = n = void 0), n = n === void 0 ? Ju : n >>> 0, n ? (e = zu(e), e && (typeof t == "string" || t != null && !Yu(t)) && (t = Vu(t), !t && qu(e)) ? ju(Xu(e), 0, n) : e.split(t, n)) : [];
|
|
1691
|
-
}
|
|
1692
|
-
var Qu = Ku;
|
|
1693
|
-
const Zu = /* @__PURE__ */ be(Qu), el = (e) => Rc(
|
|
1694
|
-
(t) => Zu(t, ""),
|
|
1695
|
-
(t) => t.map((n) => async () => e(n))
|
|
1696
|
-
), tl = async ({
|
|
1697
|
-
accumulatedKeys: e,
|
|
1698
|
-
sendKey: t,
|
|
1699
|
-
canRunTask: n
|
|
1298
|
+
mediaStream: s,
|
|
1299
|
+
isP2P: r = !1
|
|
1300
|
+
}) => (E("updatePresentation"), n.updatePresentation(s, {
|
|
1301
|
+
isP2P: r,
|
|
1302
|
+
maxBitrate: e
|
|
1303
|
+
})), ws = (n) => (e) => [...e].map((s) => async () => n(s)), Us = async ({
|
|
1304
|
+
accumulatedKeys: n,
|
|
1305
|
+
sendKey: e,
|
|
1306
|
+
canRunTask: t
|
|
1700
1307
|
}) => {
|
|
1701
|
-
const
|
|
1702
|
-
return
|
|
1703
|
-
},
|
|
1704
|
-
const
|
|
1705
|
-
if (
|
|
1706
|
-
|
|
1308
|
+
const r = ws(e)(n);
|
|
1309
|
+
return Xt(r, t);
|
|
1310
|
+
}, Ls = (n) => (t) => (E("onStartMainCam"), n.onSession("admin-start-main-cam", t)), Bs = (n) => (t) => (E("onStartMic"), n.onSession("admin-start-mic", t)), Fs = (n) => (t) => (E("onStopMainCam"), n.onSession("admin-stop-main-cam", t)), ks = (n) => (t) => (E("onStopMic"), n.onSession("admin-stop-mic", t)), Hs = ({ sipConnector: n }) => {
|
|
1311
|
+
const e = (T, g) => ({ isSyncForced: N = !1 }) => {
|
|
1312
|
+
if (N) {
|
|
1313
|
+
T();
|
|
1707
1314
|
return;
|
|
1708
1315
|
}
|
|
1709
|
-
|
|
1710
|
-
},
|
|
1316
|
+
g();
|
|
1317
|
+
}, t = Ls(n), s = Fs(n), r = Bs(n), o = ks(n);
|
|
1711
1318
|
let i = () => {
|
|
1712
|
-
},
|
|
1319
|
+
}, c = () => {
|
|
1713
1320
|
}, u = () => {
|
|
1714
|
-
},
|
|
1321
|
+
}, _ = () => {
|
|
1715
1322
|
};
|
|
1716
|
-
const
|
|
1717
|
-
onStartMainCamForced:
|
|
1718
|
-
onStartMainCamNotForced:
|
|
1719
|
-
onStopMainCamForced:
|
|
1720
|
-
onStopMainCamNotForced:
|
|
1721
|
-
onStartMicForced:
|
|
1722
|
-
onStartMicNotForced:
|
|
1723
|
-
onStopMicForced:
|
|
1724
|
-
onStopMicNotForced:
|
|
1323
|
+
const l = ({
|
|
1324
|
+
onStartMainCamForced: T,
|
|
1325
|
+
onStartMainCamNotForced: g,
|
|
1326
|
+
onStopMainCamForced: N,
|
|
1327
|
+
onStopMainCamNotForced: p,
|
|
1328
|
+
onStartMicForced: M,
|
|
1329
|
+
onStartMicNotForced: m,
|
|
1330
|
+
onStopMicForced: R,
|
|
1331
|
+
onStopMicNotForced: v
|
|
1725
1332
|
}) => {
|
|
1726
|
-
const f =
|
|
1727
|
-
|
|
1728
|
-
|
|
1333
|
+
const f = e(
|
|
1334
|
+
T,
|
|
1335
|
+
g
|
|
1729
1336
|
);
|
|
1730
|
-
i =
|
|
1731
|
-
const
|
|
1732
|
-
|
|
1733
|
-
|
|
1337
|
+
i = t(f);
|
|
1338
|
+
const b = e(
|
|
1339
|
+
N,
|
|
1340
|
+
p
|
|
1734
1341
|
);
|
|
1735
|
-
|
|
1736
|
-
const
|
|
1737
|
-
u =
|
|
1738
|
-
const
|
|
1739
|
-
|
|
1740
|
-
},
|
|
1741
|
-
i(),
|
|
1342
|
+
c = s(b);
|
|
1343
|
+
const w = e(M, m);
|
|
1344
|
+
u = r(w);
|
|
1345
|
+
const U = e(R, v);
|
|
1346
|
+
_ = o(U);
|
|
1347
|
+
}, d = () => {
|
|
1348
|
+
i(), c(), u(), _();
|
|
1742
1349
|
};
|
|
1743
1350
|
return {
|
|
1744
|
-
start: (
|
|
1745
|
-
|
|
1351
|
+
start: (T) => {
|
|
1352
|
+
l(T);
|
|
1746
1353
|
},
|
|
1747
1354
|
stop: () => {
|
|
1748
|
-
|
|
1355
|
+
d();
|
|
1749
1356
|
}
|
|
1750
1357
|
};
|
|
1751
|
-
},
|
|
1358
|
+
}, Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1752
1359
|
__proto__: null,
|
|
1753
|
-
PURGATORY_CONFERENCE_NUMBER:
|
|
1754
|
-
createSyncMediaState:
|
|
1755
|
-
error:
|
|
1756
|
-
getExtraHeaders:
|
|
1757
|
-
getUserAgent:
|
|
1758
|
-
hasPurgatory:
|
|
1759
|
-
resolveAnswerIncomingCall:
|
|
1760
|
-
resolveAskPermissionToEnableCam:
|
|
1761
|
-
resolveCallToServer:
|
|
1762
|
-
resolveConnectToServer:
|
|
1763
|
-
resolveDisconnectFromServer:
|
|
1764
|
-
resolveGetRemoteStreams:
|
|
1765
|
-
resolveOnMustStopPresentation:
|
|
1766
|
-
resolveOnUseLicense:
|
|
1767
|
-
resolveSendMediaState:
|
|
1768
|
-
resolveSendRefusalToTurnOnCam:
|
|
1769
|
-
resolveSendRefusalToTurnOnMic:
|
|
1770
|
-
resolveStartPresentation:
|
|
1771
|
-
resolveStopShareSipConnector:
|
|
1772
|
-
resolveUpdatePresentation:
|
|
1773
|
-
resolveUpdateRemoteStreams:
|
|
1774
|
-
sendDTMFAccumulated:
|
|
1775
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1776
|
-
const
|
|
1777
|
-
return
|
|
1778
|
-
}),
|
|
1779
|
-
var
|
|
1780
|
-
return ((
|
|
1781
|
-
}),
|
|
1782
|
-
const
|
|
1783
|
-
return
|
|
1784
|
-
},
|
|
1785
|
-
|
|
1786
|
-
}),
|
|
1787
|
-
sender:
|
|
1788
|
-
scaleResolutionDownBy:
|
|
1789
|
-
maxBitrate:
|
|
1790
|
-
onSetParameters:
|
|
1791
|
-
}) =>
|
|
1792
|
-
const
|
|
1793
|
-
return
|
|
1794
|
-
sender:
|
|
1795
|
-
maxBitrate:
|
|
1796
|
-
onSetParameters:
|
|
1360
|
+
PURGATORY_CONFERENCE_NUMBER: Bt,
|
|
1361
|
+
createSyncMediaState: Hs,
|
|
1362
|
+
error: gs,
|
|
1363
|
+
getExtraHeaders: Ns,
|
|
1364
|
+
getUserAgent: Rs,
|
|
1365
|
+
hasPurgatory: k,
|
|
1366
|
+
resolveAnswerIncomingCall: ls,
|
|
1367
|
+
resolveAskPermissionToEnableCam: As,
|
|
1368
|
+
resolveCallToServer: ds,
|
|
1369
|
+
resolveConnectToServer: Ss,
|
|
1370
|
+
resolveDisconnectFromServer: hs,
|
|
1371
|
+
resolveGetRemoteStreams: We,
|
|
1372
|
+
resolveOnMustStopPresentation: fs,
|
|
1373
|
+
resolveOnUseLicense: Is,
|
|
1374
|
+
resolveSendMediaState: Ms,
|
|
1375
|
+
resolveSendRefusalToTurnOnCam: Os,
|
|
1376
|
+
resolveSendRefusalToTurnOnMic: Ps,
|
|
1377
|
+
resolveStartPresentation: ps,
|
|
1378
|
+
resolveStopShareSipConnector: vs,
|
|
1379
|
+
resolveUpdatePresentation: bs,
|
|
1380
|
+
resolveUpdateRemoteStreams: qe,
|
|
1381
|
+
sendDTMFAccumulated: Us
|
|
1382
|
+
}, Symbol.toStringTag, { value: "Module" })), Vs = (n) => [...n.keys()].map((e) => n.get(e)), Ws = (n, e) => Vs(n).find((t) => t.type === e), qs = async (n) => n.getStats().then((e) => {
|
|
1383
|
+
const t = Ws(e, "codec");
|
|
1384
|
+
return t == null ? void 0 : t.mimeType;
|
|
1385
|
+
}), $s = (n) => n.find((e) => {
|
|
1386
|
+
var t;
|
|
1387
|
+
return ((t = e == null ? void 0 : e.track) == null ? void 0 : t.kind) === "video";
|
|
1388
|
+
}), Ht = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), xs = 1e6, A = (n) => n * xs, Vt = A(0.06), Ys = A(4), Gs = (n) => n <= 64 ? Vt : n <= 128 ? A(0.12) : n <= 256 ? A(0.25) : n <= 384 ? A(0.32) : n <= 426 ? A(0.38) : n <= 640 ? A(0.5) : n <= 848 ? A(0.7) : n <= 1280 ? A(1) : n <= 1920 ? A(2) : Ys, Xs = "av1", zs = (n) => Ht(n, Xs), Ks = 0.6, Wt = (n, e) => zs(e) ? n * Ks : n, Js = (n) => Wt(Vt, n), qt = (n, e) => {
|
|
1389
|
+
const t = Gs(n);
|
|
1390
|
+
return Wt(t, e);
|
|
1391
|
+
}, $t = zt(), Qs = async () => $t().catch((n) => {
|
|
1392
|
+
E("videoSendingBalancer: error", n);
|
|
1393
|
+
}), js = async (n) => ($t.add(n), Qs()), xe = async ({
|
|
1394
|
+
sender: n,
|
|
1395
|
+
scaleResolutionDownBy: e,
|
|
1396
|
+
maxBitrate: t,
|
|
1397
|
+
onSetParameters: s
|
|
1398
|
+
}) => js(async () => Lt(n, { scaleResolutionDownBy: e, maxBitrate: t }, s)), Zs = async ({ sender: n, codec: e }, t) => {
|
|
1399
|
+
const r = Js(e);
|
|
1400
|
+
return xe({
|
|
1401
|
+
sender: n,
|
|
1402
|
+
maxBitrate: r,
|
|
1403
|
+
onSetParameters: t,
|
|
1797
1404
|
scaleResolutionDownBy: 200
|
|
1798
1405
|
});
|
|
1799
|
-
},
|
|
1800
|
-
const i =
|
|
1801
|
-
return
|
|
1802
|
-
sender:
|
|
1803
|
-
maxBitrate:
|
|
1804
|
-
onSetParameters: r,
|
|
1805
|
-
scaleResolutionDownBy: 1
|
|
1806
|
-
});
|
|
1807
|
-
}, Rl = async ({
|
|
1808
|
-
sender: e,
|
|
1809
|
-
track: t,
|
|
1810
|
-
resolution: n,
|
|
1811
|
-
codec: r
|
|
1812
|
-
}, s) => {
|
|
1813
|
-
const o = t.getSettings(), i = o.width, a = o.height, [u, l] = n.split("x"), d = i / Number(u), E = a / Number(l), S = Math.max(d, E, 1), g = Pn(Number(u), r);
|
|
1814
|
-
return De({
|
|
1815
|
-
sender: e,
|
|
1816
|
-
maxBitrate: g,
|
|
1406
|
+
}, j = async ({ sender: n, track: e, codec: t }, s) => {
|
|
1407
|
+
const i = e.getSettings().width, c = qt(i, t);
|
|
1408
|
+
return xe({
|
|
1409
|
+
sender: n,
|
|
1410
|
+
maxBitrate: c,
|
|
1817
1411
|
onSetParameters: s,
|
|
1818
|
-
scaleResolutionDownBy:
|
|
1412
|
+
scaleResolutionDownBy: 1
|
|
1819
1413
|
});
|
|
1820
|
-
},
|
|
1821
|
-
mainCam: e,
|
|
1822
|
-
resolutionMainCam: t,
|
|
1414
|
+
}, er = async ({
|
|
1823
1415
|
sender: n,
|
|
1824
|
-
track:
|
|
1416
|
+
track: e,
|
|
1417
|
+
resolution: t,
|
|
1825
1418
|
codec: s
|
|
1419
|
+
}, r) => {
|
|
1420
|
+
const o = e.getSettings(), i = o.width, c = o.height, [u, _] = t.split("x"), l = i / Number(u), d = c / Number(_), h = Math.max(l, d, 1), T = qt(Number(u), s);
|
|
1421
|
+
return xe({
|
|
1422
|
+
sender: n,
|
|
1423
|
+
maxBitrate: T,
|
|
1424
|
+
onSetParameters: r,
|
|
1425
|
+
scaleResolutionDownBy: h
|
|
1426
|
+
});
|
|
1427
|
+
}, tr = async ({
|
|
1428
|
+
mainCam: n,
|
|
1429
|
+
resolutionMainCam: e,
|
|
1430
|
+
sender: t,
|
|
1431
|
+
track: s,
|
|
1432
|
+
codec: r
|
|
1826
1433
|
}, o) => {
|
|
1827
|
-
switch (
|
|
1828
|
-
case
|
|
1829
|
-
return
|
|
1830
|
-
case
|
|
1831
|
-
return
|
|
1832
|
-
case
|
|
1833
|
-
return
|
|
1834
|
-
{ sender:
|
|
1434
|
+
switch (n) {
|
|
1435
|
+
case I.PAUSE_MAIN_CAM:
|
|
1436
|
+
return Zs({ sender: t, codec: r }, o);
|
|
1437
|
+
case I.RESUME_MAIN_CAM:
|
|
1438
|
+
return j({ sender: t, track: s, codec: r }, o);
|
|
1439
|
+
case I.MAX_MAIN_CAM_RESOLUTION:
|
|
1440
|
+
return e !== void 0 ? er(
|
|
1441
|
+
{ sender: t, track: s, codec: r, resolution: e },
|
|
1835
1442
|
o
|
|
1836
|
-
) :
|
|
1443
|
+
) : j({ sender: t, track: s, codec: r }, o);
|
|
1837
1444
|
default:
|
|
1838
|
-
return
|
|
1445
|
+
return j({ sender: t, track: s, codec: r }, o);
|
|
1839
1446
|
}
|
|
1840
|
-
},
|
|
1447
|
+
}, je = {
|
|
1841
1448
|
isChanged: !1,
|
|
1842
1449
|
parameters: {
|
|
1843
1450
|
encodings: [{}],
|
|
@@ -1846,77 +1453,78 @@ const Zu = /* @__PURE__ */ be(Qu), el = (e) => Rc(
|
|
|
1846
1453
|
headerExtensions: [],
|
|
1847
1454
|
rtcp: {}
|
|
1848
1455
|
}
|
|
1849
|
-
},
|
|
1850
|
-
mainCam:
|
|
1851
|
-
resolutionMainCam:
|
|
1852
|
-
connection:
|
|
1853
|
-
onSetParameters:
|
|
1854
|
-
ignoreForCodec:
|
|
1456
|
+
}, Ze = async ({
|
|
1457
|
+
mainCam: n,
|
|
1458
|
+
resolutionMainCam: e,
|
|
1459
|
+
connection: t,
|
|
1460
|
+
onSetParameters: s,
|
|
1461
|
+
ignoreForCodec: r
|
|
1855
1462
|
}) => {
|
|
1856
|
-
const o =
|
|
1463
|
+
const o = t.getSenders(), i = $s(o);
|
|
1857
1464
|
if (!(i != null && i.track))
|
|
1858
|
-
return
|
|
1859
|
-
const
|
|
1860
|
-
return
|
|
1861
|
-
{ mainCam:
|
|
1862
|
-
|
|
1465
|
+
return je;
|
|
1466
|
+
const c = await qs(i);
|
|
1467
|
+
return Ht(c, r) ? je : tr(
|
|
1468
|
+
{ mainCam: n, resolutionMainCam: e, sender: i, codec: c, track: i.track },
|
|
1469
|
+
s
|
|
1863
1470
|
);
|
|
1864
|
-
},
|
|
1865
|
-
ignoreForCodec:
|
|
1866
|
-
onSetParameters:
|
|
1471
|
+
}, Cr = (n, {
|
|
1472
|
+
ignoreForCodec: e,
|
|
1473
|
+
onSetParameters: t
|
|
1867
1474
|
} = {}) => {
|
|
1868
|
-
const
|
|
1869
|
-
const { connection: u } =
|
|
1475
|
+
const s = async () => {
|
|
1476
|
+
const { connection: u } = n;
|
|
1870
1477
|
if (!u)
|
|
1871
1478
|
throw new Error("connection is not exist");
|
|
1872
|
-
return
|
|
1479
|
+
return Ze({
|
|
1873
1480
|
connection: u,
|
|
1874
|
-
onSetParameters:
|
|
1875
|
-
ignoreForCodec:
|
|
1481
|
+
onSetParameters: t,
|
|
1482
|
+
ignoreForCodec: e
|
|
1876
1483
|
});
|
|
1877
1484
|
};
|
|
1878
|
-
let
|
|
1879
|
-
const o = async (u) => (
|
|
1880
|
-
const { mainCam:
|
|
1881
|
-
if (!
|
|
1485
|
+
let r = s;
|
|
1486
|
+
const o = async (u) => (r = async () => {
|
|
1487
|
+
const { mainCam: _, resolutionMainCam: l } = u, { connection: d } = n;
|
|
1488
|
+
if (!d)
|
|
1882
1489
|
throw new Error("connection is not exist");
|
|
1883
|
-
return
|
|
1884
|
-
mainCam:
|
|
1885
|
-
resolutionMainCam:
|
|
1886
|
-
connection:
|
|
1887
|
-
onSetParameters:
|
|
1888
|
-
ignoreForCodec:
|
|
1490
|
+
return Ze({
|
|
1491
|
+
mainCam: _,
|
|
1492
|
+
resolutionMainCam: l,
|
|
1493
|
+
connection: d,
|
|
1494
|
+
onSetParameters: t,
|
|
1495
|
+
ignoreForCodec: e
|
|
1889
1496
|
});
|
|
1890
|
-
},
|
|
1497
|
+
}, r());
|
|
1891
1498
|
return {
|
|
1892
1499
|
subscribe: () => {
|
|
1893
|
-
|
|
1500
|
+
n.onSession("main-cam-control", o);
|
|
1894
1501
|
},
|
|
1895
1502
|
unsubscribe: () => {
|
|
1896
|
-
|
|
1503
|
+
n.offSession("main-cam-control", o);
|
|
1897
1504
|
},
|
|
1898
|
-
balanceByTrack:
|
|
1505
|
+
balanceByTrack: s,
|
|
1899
1506
|
resetMainCamControl() {
|
|
1900
|
-
|
|
1507
|
+
r = s;
|
|
1901
1508
|
},
|
|
1902
1509
|
async reBalance() {
|
|
1903
|
-
return
|
|
1510
|
+
return r();
|
|
1904
1511
|
}
|
|
1905
1512
|
};
|
|
1906
1513
|
};
|
|
1907
1514
|
export {
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1515
|
+
I as EEventsMainCAM,
|
|
1516
|
+
Z as EEventsMic,
|
|
1517
|
+
ee as EEventsSyncMediaState,
|
|
1518
|
+
Hn as EUseLicense,
|
|
1519
|
+
ur as causes,
|
|
1520
|
+
Er as constants,
|
|
1521
|
+
mr as debug,
|
|
1522
|
+
hr as default,
|
|
1523
|
+
dr as disableDebug,
|
|
1524
|
+
lr as enableDebug,
|
|
1525
|
+
_r as eventNames,
|
|
1526
|
+
qs as getCodecFromSender,
|
|
1527
|
+
Sr as hasCanceledCallError,
|
|
1528
|
+
Cr as resolveVideoSendingBalancer,
|
|
1529
|
+
Tr as tools
|
|
1922
1530
|
};
|