sip-connector 19.0.0 → 19.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{@SipConnector-Wp8bjnnP.js → @SipConnector-BOCUgqab.js} +194 -191
- package/dist/@SipConnector-CQnPH_xV.cjs +1 -0
- package/dist/AutoConnectorManager/@AutoConnectorManager.d.ts +2 -1
- package/dist/AutoConnectorManager/index.d.ts +0 -1
- package/dist/AutoConnectorManager/types.d.ts +1 -0
- package/dist/ConnectionManager/@ConnectionManager.d.ts +1 -0
- package/dist/ConnectionManager/UAFactory.d.ts +1 -1
- package/dist/ConnectionManager/utils/errors.d.ts +4 -2
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +53 -55
- package/package.json +15 -15
- package/dist/@SipConnector-DNQcZdY9.cjs +0 -1
- package/dist/AutoConnectorManager/utils/errors.d.ts +0 -2
- package/dist/AutoConnectorManager/utils/index.d.ts +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Events as U, TypedEvents as k } from "events-constructor";
|
|
2
2
|
import x from "debug";
|
|
3
|
-
import { CancelableRequest as G, isCanceledError as
|
|
4
|
-
import { resolveRequesterByTimeout as
|
|
5
|
-
import { hasCanceledError as
|
|
6
|
-
import { setup as
|
|
7
|
-
import { createStackPromises as te, isPromiseIsNotActualError as
|
|
3
|
+
import { CancelableRequest as G, isCanceledError as me } from "@krivega/cancelable-promise";
|
|
4
|
+
import { resolveRequesterByTimeout as _e, requesterByTimeoutsWithFailCalls as Me, DelayRequester as ve, hasCanceledError as fe, SetTimeoutRequest as Z } from "@krivega/timeout-requester";
|
|
5
|
+
import { hasCanceledError as Pe, repeatedCallsAsync as ee } from "repeated-calls";
|
|
6
|
+
import { setup as Oe, createActor as De } from "xstate";
|
|
7
|
+
import { createStackPromises as te, isPromiseIsNotActualError as ye } from "stack-promises";
|
|
8
8
|
import "ua-parser-js";
|
|
9
9
|
import "sequent-promises";
|
|
10
|
-
const Q = "sip-connector", d = x(Q),
|
|
10
|
+
const Q = "sip-connector", d = x(Q), Wn = () => {
|
|
11
11
|
x.enable(Q);
|
|
12
|
-
},
|
|
12
|
+
}, Hn = () => {
|
|
13
13
|
x.enable(`-${Q}`);
|
|
14
|
-
},
|
|
15
|
-
var l = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENT_SHARE_STATE = "x-webrtc-share-state", n.MUST_STOP_PRESENTATION_P2P = "x-webrtc-share-state: YOUMUSTSTOPSENDCONTENT", n.START_PRESENTATION_P2P = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.STOP_PRESENTATION_P2P = "x-webrtc-share-state: CONTENTEND", n.STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n.AVAILABLE_INCOMING_BITRATE = "X-WEBRTC-AVAILABLE-INCOMING-BITRATE", n.AUDIO_TRACK_COUNT = "X-WEBRTC-AUDIO-TRACK-COUNT", n.VIDEO_TRACK_COUNT = "X-WEBRTC-VIDEO-TRACK-COUNT", n.TRACKS_DIRECTION = "X-WEBRTC-TRACKS-DIRECTION", n))(l || {}), B = /* @__PURE__ */ ((n) => (n.AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))(B || {}), q = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n))(q || {}), f = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.RESTART = "application/vinteo.webrtc.restart", n))(f || {}), _ = /* @__PURE__ */ ((n) => (n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.STATS = "application/vinteo.webrtc.stats", n))(_ || {}), v = /* @__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))(v || {}), W = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(W || {}), H = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(H || {}),
|
|
14
|
+
}, be = "Error decline with 603", we = 1006, Ue = (n) => typeof n == "object" && n !== null && "code" in n && n.code === we, Le = (n) => n.message === be;
|
|
15
|
+
var l = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENT_SHARE_STATE = "x-webrtc-share-state", n.MUST_STOP_PRESENTATION_P2P = "x-webrtc-share-state: YOUMUSTSTOPSENDCONTENT", n.START_PRESENTATION_P2P = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.STOP_PRESENTATION_P2P = "x-webrtc-share-state: CONTENTEND", n.STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n.AVAILABLE_INCOMING_BITRATE = "X-WEBRTC-AVAILABLE-INCOMING-BITRATE", n.AUDIO_TRACK_COUNT = "X-WEBRTC-AUDIO-TRACK-COUNT", n.VIDEO_TRACK_COUNT = "X-WEBRTC-VIDEO-TRACK-COUNT", n.TRACKS_DIRECTION = "X-WEBRTC-TRACKS-DIRECTION", n))(l || {}), B = /* @__PURE__ */ ((n) => (n.AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))(B || {}), q = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n))(q || {}), f = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.RESTART = "application/vinteo.webrtc.restart", n))(f || {}), _ = /* @__PURE__ */ ((n) => (n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.STATS = "application/vinteo.webrtc.stats", n))(_ || {}), v = /* @__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))(v || {}), W = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(W || {}), H = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(H || {}), Be = /* @__PURE__ */ ((n) => (n.AUDIO = "AUDIO", n.VIDEO = "VIDEO", n.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", n))(Be || {}), u = /* @__PURE__ */ ((n) => (n.CHANNELS_NOTIFY = "channels:notify", n.PARTICIPANT_ADDED_TO_LIST_MODERATORS = "participant:added-to-list-moderators", n.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS = "participant:removed-from-list-moderators", n.PARTICIPANT_MOVE_REQUEST_TO_STREAM = "participant:move-request-to-stream", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS = "participant:move-request-to-spectators", n.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS = "participant:move-request-to-participants", n.PARTICIPATION_ACCEPTING_WORD_REQUEST = "participation:accepting-word-request", n.PARTICIPATION_CANCELLING_WORD_REQUEST = "participation:cancelling-word-request", n.WEBCAST_STARTED = "webcast:started", n.WEBCAST_STOPPED = "webcast:stopped", n.ACCOUNT_CHANGED = "account:changed", n.ACCOUNT_DELETED = "account:deleted", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "conference:participant-token-issued", n.CHANNELS = "channels", n.ENTER_ROOM = "enterRoom", n.SHARE_STATE = "shareState", n.MAIN_CAM_CONTROL = "main-cam-control", n.USE_LICENSE = "useLicense", n.ADMIN_START_MAIN_CAM = "admin-start-main-cam", n.ADMIN_STOP_MAIN_CAM = "admin-stop-main-cam", n.ADMIN_START_MIC = "admin-start-mic", n.ADMIN_STOP_MIC = "admin-stop-mic", n.ADMIN_FORCE_SYNC_MEDIA_STATE = "admin-force-sync-media-state", n.AVAILABLE_SECOND_REMOTE_STREAM = "availableSecondRemoteStream", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "notAvailableSecondRemoteStream", n.MUST_STOP_PRESENTATION = "mustStopPresentation", n.NEW_DTMF = "newDTMF", n.RESTART = "restart", n))(u || {});
|
|
16
16
|
const ne = [
|
|
17
17
|
"participation:accepting-word-request",
|
|
18
18
|
"participation:cancelling-word-request",
|
|
@@ -44,7 +44,7 @@ const ne = [
|
|
|
44
44
|
"restart"
|
|
45
45
|
];
|
|
46
46
|
var p = /* @__PURE__ */ ((n) => (n.CHANNELS = "channels", n.WEBCAST_STARTED = "WebcastStarted", n.WEBCAST_STOPPED = "WebcastStopped", n.ACCOUNT_CHANGED = "accountChanged", n.ACCOUNT_DELETED = "accountDeleted", n.ADDED_TO_LIST_MODERATORS = "addedToListModerators", n.REMOVED_FROM_LIST_MODERATORS = "removedFromListModerators", n.ACCEPTING_WORD_REQUEST = "ParticipationRequestAccepted", n.CANCELLING_WORD_REQUEST = "ParticipationRequestRejected", n.MOVE_REQUEST_TO_STREAM = "ParticipantMovedToWebcast", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "ConferenceParticipantTokenIssued", n))(p || {});
|
|
47
|
-
class
|
|
47
|
+
class Fe {
|
|
48
48
|
events;
|
|
49
49
|
connectionManager;
|
|
50
50
|
callManager;
|
|
@@ -150,7 +150,7 @@ class ke {
|
|
|
150
150
|
...e,
|
|
151
151
|
extraHeaders: s
|
|
152
152
|
}).catch((i) => {
|
|
153
|
-
if (
|
|
153
|
+
if (Le(i))
|
|
154
154
|
throw i;
|
|
155
155
|
});
|
|
156
156
|
}
|
|
@@ -460,7 +460,7 @@ class ke {
|
|
|
460
460
|
this.events.trigger(u.RESTART, r);
|
|
461
461
|
};
|
|
462
462
|
}
|
|
463
|
-
var N = /* @__PURE__ */ ((n) => (n.PEER_CONNECTION = "peerconnection", n.CONNECTING = "connecting", n.SENDING = "sending", n.PROGRESS = "progress", n.ACCEPTED = "accepted", n.CONFIRMED = "confirmed", n.ENDED = "ended", n.FAILED = "failed", n.NEW_DTMF = "newDTMF", n.NEW_INFO = "newInfo", n.HOLD = "hold", n.UNHOLD = "unhold", n.MUTED = "muted", n.UNMUTED = "unmuted", n.REINVITE = "reinvite", n.UPDATE = "update", n.REFER = "refer", n.REPLACES = "replaces", n.SDP = "sdp", n.ICE_CANDIDATE = "icecandidate", n.GET_USER_MEDIA_FAILED = "getusermediafailed", n.PEER_CONNECTION_CREATE_OFFER_FAILED = "peerconnection:createofferfailed", n.PEER_CONNECTION_CREATE_ANSWER_FAILED = "peerconnection:createanswerfailed", n.PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED = "peerconnection:setlocaldescriptionfailed", n.PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED = "peerconnection:setremotedescriptionfailed", n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n.PEER_CONNECTION_CONFIRMED = "peerconnection:confirmed", n.PEER_CONNECTION_ONTRACK = "peerconnection:ontrack", n.ENDED_FROM_SERVER = "ended:fromserver", n.CALL_STATUS_CHANGED = "call-status-changed", n))(N || {}),
|
|
463
|
+
var N = /* @__PURE__ */ ((n) => (n.PEER_CONNECTION = "peerconnection", n.CONNECTING = "connecting", n.SENDING = "sending", n.PROGRESS = "progress", n.ACCEPTED = "accepted", n.CONFIRMED = "confirmed", n.ENDED = "ended", n.FAILED = "failed", n.NEW_DTMF = "newDTMF", n.NEW_INFO = "newInfo", n.HOLD = "hold", n.UNHOLD = "unhold", n.MUTED = "muted", n.UNMUTED = "unmuted", n.REINVITE = "reinvite", n.UPDATE = "update", n.REFER = "refer", n.REPLACES = "replaces", n.SDP = "sdp", n.ICE_CANDIDATE = "icecandidate", n.GET_USER_MEDIA_FAILED = "getusermediafailed", n.PEER_CONNECTION_CREATE_OFFER_FAILED = "peerconnection:createofferfailed", n.PEER_CONNECTION_CREATE_ANSWER_FAILED = "peerconnection:createanswerfailed", n.PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED = "peerconnection:setlocaldescriptionfailed", n.PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED = "peerconnection:setremotedescriptionfailed", n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n.PEER_CONNECTION_CONFIRMED = "peerconnection:confirmed", n.PEER_CONNECTION_ONTRACK = "peerconnection:ontrack", n.ENDED_FROM_SERVER = "ended:fromserver", n.CALL_STATUS_CHANGED = "call-status-changed", n))(N || {}), ke = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))(ke || {});
|
|
464
464
|
const se = [
|
|
465
465
|
"peerconnection",
|
|
466
466
|
"connecting",
|
|
@@ -488,15 +488,15 @@ const se = [
|
|
|
488
488
|
"peerconnection:createanswerfailed",
|
|
489
489
|
"peerconnection:setlocaldescriptionfailed",
|
|
490
490
|
"peerconnection:setremotedescriptionfailed"
|
|
491
|
-
],
|
|
491
|
+
], $e = [
|
|
492
492
|
"peerconnection:confirmed",
|
|
493
493
|
"peerconnection:ontrack",
|
|
494
494
|
"ended:fromserver",
|
|
495
495
|
"call-status-changed"
|
|
496
496
|
], ie = [
|
|
497
497
|
...se,
|
|
498
|
-
|
|
499
|
-
],
|
|
498
|
+
...$e
|
|
499
|
+
], Ve = (n, e) => {
|
|
500
500
|
n.getVideoTracks().forEach((s) => {
|
|
501
501
|
"contentHint" in s && s.contentHint !== e && (s.contentHint = e);
|
|
502
502
|
});
|
|
@@ -508,16 +508,16 @@ const se = [
|
|
|
508
508
|
if (!n || e === "recvonly" && t === "recvonly")
|
|
509
509
|
return;
|
|
510
510
|
const i = t === "recvonly" ? [] : n.getAudioTracks(), r = e === "recvonly" ? [] : n.getVideoTracks(), a = [...i, ...r], o = new MediaStream(a);
|
|
511
|
-
return o.getTracks = () => [...o.getAudioTracks(), ...o.getVideoTracks()], s && s !== "none" &&
|
|
511
|
+
return o.getTracks = () => [...o.getAudioTracks(), ...o.getVideoTracks()], s && s !== "none" && Ve(o, s), o;
|
|
512
512
|
};
|
|
513
|
-
function
|
|
513
|
+
function qe(n) {
|
|
514
514
|
return (e) => `sip:${e}@${n}`;
|
|
515
515
|
}
|
|
516
|
-
const
|
|
516
|
+
const We = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, re = (n) => n.trim().replaceAll(" ", "_"), He = We(1e5, 99999999), xe = (n) => n.some((t) => {
|
|
517
517
|
const { kind: s } = t;
|
|
518
518
|
return s === "video";
|
|
519
519
|
});
|
|
520
|
-
class
|
|
520
|
+
class Ge {
|
|
521
521
|
isPendingCall = !1;
|
|
522
522
|
isPendingAnswer = !1;
|
|
523
523
|
rtcSession;
|
|
@@ -529,7 +529,7 @@ class Qe {
|
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
var ae = /* @__PURE__ */ ((n) => (n.BYE = "Terminated", n.WEBRTC_ERROR = "WebRTC Error", n.CANCELED = "Canceled", n.REQUEST_TIMEOUT = "Request Timeout", n.REJECTED = "Rejected", n.REDIRECTED = "Redirected", n.UNAVAILABLE = "Unavailable", n.NOT_FOUND = "Not Found", n.ADDRESS_INCOMPLETE = "Address Incomplete", n.INCOMPATIBLE_SDP = "Incompatible SDP", n.BAD_MEDIA_DESCRIPTION = "Bad Media Description", n))(ae || {});
|
|
532
|
-
class
|
|
532
|
+
class Qe {
|
|
533
533
|
remoteStreams = {};
|
|
534
534
|
reset() {
|
|
535
535
|
this.remoteStreams = {};
|
|
@@ -558,8 +558,8 @@ class Ye {
|
|
|
558
558
|
return e.map((t) => this.generateAudioStream(t));
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
|
-
class
|
|
562
|
-
remoteStreamsManager = new
|
|
561
|
+
class Ye extends Ge {
|
|
562
|
+
remoteStreamsManager = new Qe();
|
|
563
563
|
disposers = /* @__PURE__ */ new Set();
|
|
564
564
|
constructor(e) {
|
|
565
565
|
super(e), e.on(N.FAILED, this.handleEnded), e.on(N.ENDED, this.handleEnded);
|
|
@@ -684,7 +684,7 @@ class ze extends Qe {
|
|
|
684
684
|
if (!this.connection)
|
|
685
685
|
return;
|
|
686
686
|
const t = this.connection.getReceivers().map(({ track: s }) => s);
|
|
687
|
-
return
|
|
687
|
+
return xe(t) ? this.remoteStreamsManager.generateStreams(t) : this.remoteStreamsManager.generateAudioStreams(t);
|
|
688
688
|
}
|
|
689
689
|
async replaceMediaStream(e, t) {
|
|
690
690
|
if (!this.rtcSession)
|
|
@@ -753,11 +753,11 @@ class ze extends Qe {
|
|
|
753
753
|
delete this.rtcSession, this.remoteStreamsManager.reset(), this.unsubscribeFromSessionEvents(), this.callConfiguration.number = void 0, this.callConfiguration.answer = !1;
|
|
754
754
|
};
|
|
755
755
|
}
|
|
756
|
-
class
|
|
756
|
+
class ze {
|
|
757
757
|
events;
|
|
758
758
|
strategy;
|
|
759
759
|
constructor(e) {
|
|
760
|
-
this.events = new k(ie), this.strategy = e ?? new
|
|
760
|
+
this.events = new k(ie), this.strategy = e ?? new Ye(this.events), this.subscribeCallStatusChange();
|
|
761
761
|
}
|
|
762
762
|
get requested() {
|
|
763
763
|
return this.strategy.requested;
|
|
@@ -813,39 +813,39 @@ class Xe {
|
|
|
813
813
|
return t !== e && this.events.trigger(N.CALL_STATUS_CHANGED, { isCallActive: t }), t;
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
|
-
const
|
|
816
|
+
const Xe = (n, e) => (n.degradationPreference = e.degradationPreference, n), Je = (n, e) => {
|
|
817
817
|
n.encodings ??= [];
|
|
818
818
|
for (let t = n.encodings.length; t < e; t += 1)
|
|
819
819
|
n.encodings.push({});
|
|
820
820
|
return n;
|
|
821
|
-
}, oe = (n) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== n,
|
|
822
|
-
if (
|
|
821
|
+
}, oe = (n) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== n, Ke = oe(), je = (n, e) => {
|
|
822
|
+
if (Ke(n, e))
|
|
823
823
|
return n;
|
|
824
|
-
},
|
|
825
|
-
const t = n.maxBitrate, s =
|
|
824
|
+
}, Ze = (n, e) => {
|
|
825
|
+
const t = n.maxBitrate, s = je(e, t);
|
|
826
826
|
return s !== void 0 && (n.maxBitrate = s), n;
|
|
827
|
-
}, ce = 1,
|
|
827
|
+
}, ce = 1, et = oe(
|
|
828
828
|
ce
|
|
829
|
-
),
|
|
829
|
+
), tt = (n, e) => {
|
|
830
830
|
const t = n === void 0 ? void 0 : Math.max(n, ce);
|
|
831
|
-
if (t !== void 0 &&
|
|
831
|
+
if (t !== void 0 && et(
|
|
832
832
|
t,
|
|
833
833
|
e
|
|
834
834
|
))
|
|
835
835
|
return t;
|
|
836
|
-
},
|
|
837
|
-
const t = n.scaleResolutionDownBy, s =
|
|
836
|
+
}, nt = (n, e) => {
|
|
837
|
+
const t = n.scaleResolutionDownBy, s = tt(
|
|
838
838
|
e,
|
|
839
839
|
t
|
|
840
840
|
);
|
|
841
841
|
return s !== void 0 && (n.scaleResolutionDownBy = s), n;
|
|
842
|
-
},
|
|
842
|
+
}, st = (n, e) => {
|
|
843
843
|
const t = e.encodings?.length ?? 0;
|
|
844
|
-
return
|
|
844
|
+
return Je(n, t), n.encodings.forEach((s, i) => {
|
|
845
845
|
const r = (e?.encodings ?? [])[i], a = r?.maxBitrate, o = r?.scaleResolutionDownBy;
|
|
846
|
-
|
|
846
|
+
Ze(s, a), nt(s, o);
|
|
847
847
|
}), n;
|
|
848
|
-
},
|
|
848
|
+
}, it = (n, e) => {
|
|
849
849
|
if (n.codecs?.length !== e.codecs?.length)
|
|
850
850
|
return !0;
|
|
851
851
|
for (let t = 0; t < (n.codecs?.length ?? 0); t++)
|
|
@@ -862,15 +862,15 @@ const Je = (n, e) => (n.degradationPreference = e.degradationPreference, n), Ke
|
|
|
862
862
|
if (JSON.stringify(n.encodings[t]) !== JSON.stringify(e.encodings[t]))
|
|
863
863
|
return !0;
|
|
864
864
|
return n.rtcp?.cname !== e.rtcp?.cname || n.rtcp?.reducedSize !== e.rtcp?.reducedSize || n.degradationPreference !== e.degradationPreference;
|
|
865
|
-
},
|
|
865
|
+
}, rt = async (n, e) => {
|
|
866
866
|
const t = n.getParameters(), s = JSON.parse(
|
|
867
867
|
JSON.stringify(t)
|
|
868
868
|
);
|
|
869
|
-
|
|
870
|
-
const i =
|
|
869
|
+
st(t, e), Xe(t, e);
|
|
870
|
+
const i = it(s, t);
|
|
871
871
|
return i && await n.setParameters(t), { parameters: t, isChanged: i };
|
|
872
872
|
}, de = async (n, e, t) => {
|
|
873
|
-
const { isChanged: s, parameters: i } = await
|
|
873
|
+
const { isChanged: s, parameters: i } = await rt(n, {
|
|
874
874
|
encodings: [
|
|
875
875
|
{
|
|
876
876
|
scaleResolutionDownBy: e.scaleResolutionDownBy,
|
|
@@ -879,8 +879,8 @@ const Je = (n, e) => (n.degradationPreference = e.degradationPreference, n), Ke
|
|
|
879
879
|
]
|
|
880
880
|
});
|
|
881
881
|
return s && t && t(i), { isChanged: s, parameters: i };
|
|
882
|
-
},
|
|
883
|
-
const s =
|
|
882
|
+
}, at = (n, e) => n.find((t) => t.track !== null && e.getTracks().includes(t.track)), ot = async (n, e, t) => {
|
|
883
|
+
const s = at(n, e);
|
|
884
884
|
if (s)
|
|
885
885
|
return de(s, { maxBitrate: t });
|
|
886
886
|
};
|
|
@@ -891,8 +891,8 @@ const he = [
|
|
|
891
891
|
"presentation:end",
|
|
892
892
|
"presentation:ended",
|
|
893
893
|
"presentation:failed"
|
|
894
|
-
],
|
|
895
|
-
class
|
|
894
|
+
], ct = 1, xn = (n) => Pe(n);
|
|
895
|
+
class dt {
|
|
896
896
|
events;
|
|
897
897
|
promisePendingStartPresentation;
|
|
898
898
|
promisePendingStopPresentation;
|
|
@@ -999,7 +999,7 @@ class ht {
|
|
|
999
999
|
stream: s,
|
|
1000
1000
|
presentationOptions: i,
|
|
1001
1001
|
options: r = {
|
|
1002
|
-
callLimit:
|
|
1002
|
+
callLimit: ct
|
|
1003
1003
|
}
|
|
1004
1004
|
}) {
|
|
1005
1005
|
const a = async () => this.sendPresentation(
|
|
@@ -1043,7 +1043,7 @@ class ht {
|
|
|
1043
1043
|
if (!e || !t || s === void 0)
|
|
1044
1044
|
return;
|
|
1045
1045
|
const i = e.getSenders();
|
|
1046
|
-
await
|
|
1046
|
+
await ot(i, t, s);
|
|
1047
1047
|
};
|
|
1048
1048
|
getRtcSessionProtected = () => {
|
|
1049
1049
|
const e = this.callManager.getEstablishedRTCSession();
|
|
@@ -1064,7 +1064,7 @@ class ht {
|
|
|
1064
1064
|
delete this.streamPresentationCurrent;
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
|
-
class
|
|
1067
|
+
class ht {
|
|
1068
1068
|
data = {};
|
|
1069
1069
|
getUa;
|
|
1070
1070
|
constructor(e) {
|
|
@@ -1148,13 +1148,13 @@ const le = [
|
|
|
1148
1148
|
"registrationFailed",
|
|
1149
1149
|
"newMessage",
|
|
1150
1150
|
"sipEvent"
|
|
1151
|
-
],
|
|
1151
|
+
], lt = [
|
|
1152
1152
|
"disconnecting",
|
|
1153
1153
|
"connect-started",
|
|
1154
1154
|
"connect-succeeded",
|
|
1155
1155
|
"connect-failed"
|
|
1156
|
-
], ge = [...le, ...
|
|
1157
|
-
class
|
|
1156
|
+
], ge = [...le, ...lt], gt = 3;
|
|
1157
|
+
class ut {
|
|
1158
1158
|
cancelableConnectWithRepeatedCalls;
|
|
1159
1159
|
JsSIP;
|
|
1160
1160
|
events;
|
|
@@ -1198,9 +1198,9 @@ class Tt {
|
|
|
1198
1198
|
cancelRequests() {
|
|
1199
1199
|
this.cancelConnectWithRepeatedCalls();
|
|
1200
1200
|
}
|
|
1201
|
-
connectWithDuplicatedCalls = async (e, { callLimit: t =
|
|
1201
|
+
connectWithDuplicatedCalls = async (e, { callLimit: t = gt } = {}) => {
|
|
1202
1202
|
const s = async () => this.connectInner(e), i = (r) => {
|
|
1203
|
-
const c = this.getUa()?.isConnected() === !0 && this.hasEqualConnectionConfiguration(e), h = r != null && !
|
|
1203
|
+
const c = this.getUa()?.isConnected() === !0 && this.hasEqualConnectionConfiguration(e), h = r != null && !Ue(r);
|
|
1204
1204
|
return c || h;
|
|
1205
1205
|
};
|
|
1206
1206
|
return this.stateMachine.startConnect(), this.cancelableConnectWithRepeatedCalls = ee({
|
|
@@ -1291,7 +1291,7 @@ class Tt {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
1293
|
var ue = /* @__PURE__ */ ((n) => (n.START_CONNECT = "START_CONNECT", n.START_INIT_UA = "START_INIT_UA", n.UA_CONNECTED = "UA_CONNECTED", n.UA_REGISTERED = "UA_REGISTERED", n.UA_UNREGISTERED = "UA_UNREGISTERED", n.UA_DISCONNECTED = "UA_DISCONNECTED", n.CONNECTION_FAILED = "CONNECTION_FAILED", n.RESET = "RESET", n))(ue || {});
|
|
1294
|
-
const
|
|
1294
|
+
const Tt = Oe({
|
|
1295
1295
|
types: {
|
|
1296
1296
|
context: {},
|
|
1297
1297
|
events: {}
|
|
@@ -1605,14 +1605,14 @@ const St = De({
|
|
|
1605
1605
|
}
|
|
1606
1606
|
}
|
|
1607
1607
|
});
|
|
1608
|
-
class
|
|
1608
|
+
class St {
|
|
1609
1609
|
actor;
|
|
1610
1610
|
stateChangeListeners = /* @__PURE__ */ new Set();
|
|
1611
1611
|
events;
|
|
1612
1612
|
unsubscribeFromEvents;
|
|
1613
1613
|
actorSubscription;
|
|
1614
1614
|
constructor(e) {
|
|
1615
|
-
this.events = e, this.actor =
|
|
1615
|
+
this.events = e, this.actor = De(Tt), this.actorSubscription = this.actor.subscribe((t) => {
|
|
1616
1616
|
const s = t.value;
|
|
1617
1617
|
this.stateChangeListeners.forEach((i) => {
|
|
1618
1618
|
i(s);
|
|
@@ -1767,7 +1767,7 @@ class Ct {
|
|
|
1767
1767
|
};
|
|
1768
1768
|
}
|
|
1769
1769
|
}
|
|
1770
|
-
class
|
|
1770
|
+
class Ct {
|
|
1771
1771
|
events;
|
|
1772
1772
|
getUaProtected;
|
|
1773
1773
|
constructor(e) {
|
|
@@ -1804,7 +1804,7 @@ class Et {
|
|
|
1804
1804
|
};
|
|
1805
1805
|
}
|
|
1806
1806
|
}
|
|
1807
|
-
class
|
|
1807
|
+
class Et {
|
|
1808
1808
|
uaFactory;
|
|
1809
1809
|
getUaProtected;
|
|
1810
1810
|
constructor(e) {
|
|
@@ -1869,7 +1869,7 @@ class At {
|
|
|
1869
1869
|
});
|
|
1870
1870
|
}
|
|
1871
1871
|
}
|
|
1872
|
-
const
|
|
1872
|
+
const At = (n) => {
|
|
1873
1873
|
const e = [];
|
|
1874
1874
|
return n !== void 0 && n !== "" && e.push(`X-Vinteo-Remote: ${n}`), e;
|
|
1875
1875
|
};
|
|
@@ -1881,7 +1881,7 @@ class D {
|
|
|
1881
1881
|
static isRegisteredUA(e) {
|
|
1882
1882
|
return !!e && e.isRegistered();
|
|
1883
1883
|
}
|
|
1884
|
-
static
|
|
1884
|
+
static validateParametersConnection({
|
|
1885
1885
|
register: e,
|
|
1886
1886
|
password: t,
|
|
1887
1887
|
user: s,
|
|
@@ -1898,10 +1898,10 @@ class D {
|
|
|
1898
1898
|
throw new Error("user is required for authorized connection");
|
|
1899
1899
|
}
|
|
1900
1900
|
static resolveAuthorizationUser(e, t) {
|
|
1901
|
-
return e && t !== void 0 && t.trim() !== "" ? t.trim() : `${
|
|
1901
|
+
return e && t !== void 0 && t.trim() !== "" ? t.trim() : `${He()}`;
|
|
1902
1902
|
}
|
|
1903
1903
|
static buildExtraHeaders(e, t) {
|
|
1904
|
-
const s = e !== void 0 && e !== "" ?
|
|
1904
|
+
const s = e !== void 0 && e !== "" ? At(e) : [];
|
|
1905
1905
|
return t === void 0 ? s : [...s, ...t];
|
|
1906
1906
|
}
|
|
1907
1907
|
createConfiguration({
|
|
@@ -1918,14 +1918,14 @@ class D {
|
|
|
1918
1918
|
connectionRecoveryMaxInterval: T = 6,
|
|
1919
1919
|
userAgent: S
|
|
1920
1920
|
}) {
|
|
1921
|
-
D.
|
|
1921
|
+
D.validateParametersConnection({
|
|
1922
1922
|
register: a,
|
|
1923
1923
|
password: t,
|
|
1924
1924
|
user: e,
|
|
1925
1925
|
sipServerUrl: r,
|
|
1926
1926
|
sipWebSocketServerURL: s
|
|
1927
1927
|
});
|
|
1928
|
-
const g = D.resolveAuthorizationUser(a, e), C =
|
|
1928
|
+
const g = D.resolveAuthorizationUser(a, e), C = qe(r), m = C(g), I = new this.JsSIP.WebSocketInterface(s);
|
|
1929
1929
|
return {
|
|
1930
1930
|
configuration: {
|
|
1931
1931
|
password: t,
|
|
@@ -1965,8 +1965,8 @@ class D {
|
|
|
1965
1965
|
}), { ua: r, helpers: i };
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
|
-
const Te = "Not ready for connection",
|
|
1969
|
-
class
|
|
1968
|
+
const Te = "Not ready for connection", Nt = (n) => n instanceof Error && n.message === Te, Rt = () => new Error(Te), It = async (n) => typeof n == "function" ? n() : n;
|
|
1969
|
+
class pt {
|
|
1970
1970
|
events;
|
|
1971
1971
|
ua;
|
|
1972
1972
|
socket;
|
|
@@ -1978,15 +1978,15 @@ class mt {
|
|
|
1978
1978
|
configurationManager;
|
|
1979
1979
|
JsSIP;
|
|
1980
1980
|
constructor({ JsSIP: e }) {
|
|
1981
|
-
this.JsSIP = e, this.events = new U(ge), this.uaFactory = new D(e), this.registrationManager = new
|
|
1981
|
+
this.JsSIP = e, this.events = new U(ge), this.uaFactory = new D(e), this.registrationManager = new Ct({
|
|
1982
1982
|
events: this.events,
|
|
1983
1983
|
getUaProtected: this.getUaProtected
|
|
1984
|
-
}), this.stateMachine = new
|
|
1984
|
+
}), this.stateMachine = new St(this.events), this.configurationManager = new ht({
|
|
1985
1985
|
getUa: this.getUa
|
|
1986
|
-
}), this.sipOperations = new
|
|
1986
|
+
}), this.sipOperations = new Et({
|
|
1987
1987
|
uaFactory: this.uaFactory,
|
|
1988
1988
|
getUaProtected: this.getUaProtected
|
|
1989
|
-
}), this.connectionFlow = new
|
|
1989
|
+
}), this.connectionFlow = new ut({
|
|
1990
1990
|
JsSIP: this.JsSIP,
|
|
1991
1991
|
events: this.events,
|
|
1992
1992
|
uaFactory: this.uaFactory,
|
|
@@ -2020,6 +2020,9 @@ class mt {
|
|
|
2020
2020
|
get isPendingInitUa() {
|
|
2021
2021
|
return this.stateMachine.isPendingInitUa;
|
|
2022
2022
|
}
|
|
2023
|
+
get isIdle() {
|
|
2024
|
+
return this.stateMachine.isIdle;
|
|
2025
|
+
}
|
|
2023
2026
|
get isDisconnected() {
|
|
2024
2027
|
return this.stateMachine.isDisconnected;
|
|
2025
2028
|
}
|
|
@@ -2089,7 +2092,7 @@ class mt {
|
|
|
2089
2092
|
getUa = () => this.ua;
|
|
2090
2093
|
connectWithProcessError = async (e, t) => {
|
|
2091
2094
|
if (!(t?.hasReadyForConnection?.() ?? !0))
|
|
2092
|
-
throw
|
|
2095
|
+
throw Rt();
|
|
2093
2096
|
return this.processConnect(e, t).catch(async (i) => {
|
|
2094
2097
|
const r = i;
|
|
2095
2098
|
return this.disconnect().then(() => {
|
|
@@ -2099,12 +2102,12 @@ class mt {
|
|
|
2099
2102
|
});
|
|
2100
2103
|
});
|
|
2101
2104
|
};
|
|
2102
|
-
processConnect = async (e, t) => (this.events.trigger(A.CONNECT_STARTED, {}),
|
|
2105
|
+
processConnect = async (e, t) => (this.events.trigger(A.CONNECT_STARTED, {}), It(e).then(async (s) => this.connectionFlow.connect(s, t)).then((s) => (this.events.trigger(A.CONNECT_SUCCEEDED, { ua: s }), s)).catch((s) => {
|
|
2103
2106
|
const i = s ?? new Error("Failed to connect to server");
|
|
2104
2107
|
throw this.events.trigger(A.CONNECT_FAILED, i), i;
|
|
2105
2108
|
}));
|
|
2106
2109
|
}
|
|
2107
|
-
class
|
|
2110
|
+
class mt {
|
|
2108
2111
|
connectionManager;
|
|
2109
2112
|
stackPromises = te({
|
|
2110
2113
|
noRunIsNotActual: !0
|
|
@@ -2125,12 +2128,12 @@ const Se = [
|
|
|
2125
2128
|
"failed-attempt",
|
|
2126
2129
|
"cancelled-attempt",
|
|
2127
2130
|
"changed-attempt-status"
|
|
2128
|
-
], z = 0,
|
|
2129
|
-
class
|
|
2131
|
+
], z = 0, _t = 30;
|
|
2132
|
+
class Mt {
|
|
2130
2133
|
events;
|
|
2131
2134
|
countInner = z;
|
|
2132
2135
|
initialCount = z;
|
|
2133
|
-
limitInner =
|
|
2136
|
+
limitInner = _t;
|
|
2134
2137
|
isInProgress = !1;
|
|
2135
2138
|
constructor({ events: e }) {
|
|
2136
2139
|
this.events = e;
|
|
@@ -2163,7 +2166,7 @@ class vt {
|
|
|
2163
2166
|
this.events.trigger(O.CHANGED_ATTEMPT_STATUS, { isInProgress: this.isInProgress });
|
|
2164
2167
|
}
|
|
2165
2168
|
}
|
|
2166
|
-
class
|
|
2169
|
+
class vt {
|
|
2167
2170
|
connectionManager;
|
|
2168
2171
|
interval;
|
|
2169
2172
|
checkTelephonyByTimeout = void 0;
|
|
@@ -2179,7 +2182,7 @@ class ft {
|
|
|
2179
2182
|
onSuccessRequest: t,
|
|
2180
2183
|
onFailRequest: s
|
|
2181
2184
|
}) {
|
|
2182
|
-
this.stop(), this.cancelableBeforeRequest = new G(e), this.checkTelephonyByTimeout =
|
|
2185
|
+
this.stop(), this.cancelableBeforeRequest = new G(e), this.checkTelephonyByTimeout = _e({
|
|
2183
2186
|
isDontStopOnFail: !0,
|
|
2184
2187
|
requestInterval: this.interval,
|
|
2185
2188
|
request: async () => {
|
|
@@ -2199,15 +2202,15 @@ class ft {
|
|
|
2199
2202
|
this.checkTelephonyByTimeout?.stop(), this.checkTelephonyByTimeout = void 0, this.cancelableBeforeRequest?.cancelRequest(), this.cancelableBeforeRequest = void 0;
|
|
2200
2203
|
}
|
|
2201
2204
|
}
|
|
2202
|
-
const
|
|
2203
|
-
class
|
|
2205
|
+
const ft = 15e3, Pt = 2;
|
|
2206
|
+
class Ot {
|
|
2204
2207
|
connectionManager;
|
|
2205
2208
|
pingServerByTimeoutWithFailCalls;
|
|
2206
2209
|
constructor({ connectionManager: e }) {
|
|
2207
|
-
this.connectionManager = e, this.pingServerByTimeoutWithFailCalls =
|
|
2210
|
+
this.connectionManager = e, this.pingServerByTimeoutWithFailCalls = Me(Pt, {
|
|
2208
2211
|
whenPossibleRequest: async () => {
|
|
2209
2212
|
},
|
|
2210
|
-
requestInterval:
|
|
2213
|
+
requestInterval: ft,
|
|
2211
2214
|
request: async () => (d("ping"), this.connectionManager.ping().then(() => {
|
|
2212
2215
|
d("ping success");
|
|
2213
2216
|
}))
|
|
@@ -2220,7 +2223,7 @@ class Dt {
|
|
|
2220
2223
|
this.pingServerByTimeoutWithFailCalls.stop();
|
|
2221
2224
|
}
|
|
2222
2225
|
}
|
|
2223
|
-
class
|
|
2226
|
+
class Dt {
|
|
2224
2227
|
callManager;
|
|
2225
2228
|
pingServerRequester;
|
|
2226
2229
|
disposeCallStatusChange;
|
|
@@ -2228,7 +2231,7 @@ class yt {
|
|
|
2228
2231
|
connectionManager: e,
|
|
2229
2232
|
callManager: t
|
|
2230
2233
|
}) {
|
|
2231
|
-
this.callManager = t, this.pingServerRequester = new
|
|
2234
|
+
this.callManager = t, this.pingServerRequester = new Ot({
|
|
2232
2235
|
connectionManager: e
|
|
2233
2236
|
});
|
|
2234
2237
|
}
|
|
@@ -2247,7 +2250,7 @@ class yt {
|
|
|
2247
2250
|
this.callManager.isCallActive ? this.pingServerRequester.stop() : this.pingServerRequester.start({ onFailRequest: e });
|
|
2248
2251
|
}
|
|
2249
2252
|
}
|
|
2250
|
-
class
|
|
2253
|
+
class yt {
|
|
2251
2254
|
connectionManager;
|
|
2252
2255
|
callManager;
|
|
2253
2256
|
isRegistrationFailed = !1;
|
|
@@ -2281,9 +2284,9 @@ class bt {
|
|
|
2281
2284
|
this.isRegistrationFailed = !1;
|
|
2282
2285
|
}
|
|
2283
2286
|
}
|
|
2284
|
-
const
|
|
2285
|
-
};
|
|
2286
|
-
class
|
|
2287
|
+
const bt = 3e3, wt = 15e3, Ut = async () => {
|
|
2288
|
+
}, Lt = (n) => !0;
|
|
2289
|
+
class Bt {
|
|
2287
2290
|
events;
|
|
2288
2291
|
connectionManager;
|
|
2289
2292
|
connectionQueueManager;
|
|
@@ -2294,25 +2297,26 @@ class Ft {
|
|
|
2294
2297
|
delayBetweenAttempts;
|
|
2295
2298
|
cancelableRequestBeforeRetry;
|
|
2296
2299
|
onBeforeRetry;
|
|
2300
|
+
canRetryOnError;
|
|
2297
2301
|
constructor({
|
|
2298
2302
|
connectionQueueManager: e,
|
|
2299
2303
|
connectionManager: t,
|
|
2300
2304
|
callManager: s
|
|
2301
2305
|
}, i) {
|
|
2302
|
-
const r = i?.onBeforeRetry ??
|
|
2303
|
-
this.connectionQueueManager = e, this.connectionManager = t, this.onBeforeRetry = r, this.events = new k(Se), this.checkTelephonyRequester = new
|
|
2306
|
+
const r = i?.onBeforeRetry ?? Ut, a = i?.canRetryOnError ?? Lt;
|
|
2307
|
+
this.connectionQueueManager = e, this.connectionManager = t, this.onBeforeRetry = r, this.canRetryOnError = a, this.events = new k(Se), this.checkTelephonyRequester = new vt({
|
|
2304
2308
|
connectionManager: t,
|
|
2305
|
-
interval: i?.checkTelephonyRequestInterval ??
|
|
2306
|
-
}), this.pingServerIfNotActiveCallRequester = new
|
|
2309
|
+
interval: i?.checkTelephonyRequestInterval ?? wt
|
|
2310
|
+
}), this.pingServerIfNotActiveCallRequester = new Dt({
|
|
2307
2311
|
connectionManager: t,
|
|
2308
2312
|
callManager: s
|
|
2309
|
-
}), this.registrationFailedOutOfCallSubscriber = new
|
|
2313
|
+
}), this.registrationFailedOutOfCallSubscriber = new yt({
|
|
2310
2314
|
connectionManager: t,
|
|
2311
2315
|
callManager: s
|
|
2312
|
-
}), this.attemptsState = new
|
|
2316
|
+
}), this.attemptsState = new Mt({
|
|
2313
2317
|
events: this.events
|
|
2314
|
-
}), this.cancelableRequestBeforeRetry = new G(r), this.delayBetweenAttempts = new
|
|
2315
|
-
i?.timeoutBetweenAttempts ??
|
|
2318
|
+
}), this.cancelableRequestBeforeRetry = new G(r), this.delayBetweenAttempts = new ve(
|
|
2319
|
+
i?.timeoutBetweenAttempts ?? bt
|
|
2316
2320
|
);
|
|
2317
2321
|
}
|
|
2318
2322
|
start(e) {
|
|
@@ -2368,15 +2372,15 @@ class Ft {
|
|
|
2368
2372
|
try {
|
|
2369
2373
|
await this.connectionQueueManager.connect(e.getParameters, e.options), d("processConnect success"), this.handleSucceededAttempt(e);
|
|
2370
2374
|
} catch (t) {
|
|
2371
|
-
if (
|
|
2375
|
+
if (Nt(t)) {
|
|
2372
2376
|
this.handleSucceededAttempt(e);
|
|
2373
2377
|
return;
|
|
2374
2378
|
}
|
|
2375
|
-
if (
|
|
2376
|
-
d("processConnect:
|
|
2379
|
+
if (!this.canRetryOnError(t)) {
|
|
2380
|
+
d("processConnect: error does not allow retry", t);
|
|
2377
2381
|
return;
|
|
2378
2382
|
}
|
|
2379
|
-
if (
|
|
2383
|
+
if (ye(t)) {
|
|
2380
2384
|
d("processConnect: not actual error", t), this.events.trigger(O.CANCELLED_ATTEMPT, t);
|
|
2381
2385
|
return;
|
|
2382
2386
|
}
|
|
@@ -2405,27 +2409,27 @@ class Ft {
|
|
|
2405
2409
|
reconnect(e) {
|
|
2406
2410
|
d("reconnect"), this.delayBetweenAttempts.request().then(async () => (d("reconnect: delayBetweenAttempts success"), this.cancelableRequestBeforeRetry.request())).then(async () => (d("reconnect: onBeforeRetry success"), this.connect(e))).catch((t) => {
|
|
2407
2411
|
const s = t instanceof Error ? t : new Error("Failed to reconnect");
|
|
2408
|
-
|
|
2412
|
+
me(t) || fe(t) ? this.events.trigger(O.CANCELLED_ATTEMPT, s) : this.events.trigger(O.FAILED_ATTEMPT, s), d("reconnect: error", t);
|
|
2409
2413
|
});
|
|
2410
2414
|
}
|
|
2411
2415
|
hasFailedOrDisconnectedConnection() {
|
|
2412
|
-
const { isFailed: e, isDisconnected: t } = this.connectionManager;
|
|
2413
|
-
return e || t;
|
|
2416
|
+
const { isFailed: e, isDisconnected: t, isIdle: s } = this.connectionManager;
|
|
2417
|
+
return e || t || s;
|
|
2414
2418
|
}
|
|
2415
2419
|
}
|
|
2416
2420
|
var w = /* @__PURE__ */ ((n) => (n.INCOMING_CALL = "incomingCall", n.DECLINED_INCOMING_CALL = "declinedIncomingCall", n.TERMINATED_INCOMING_CALL = "terminatedIncomingCall", n.FAILED_INCOMING_CALL = "failedIncomingCall", n))(w || {});
|
|
2417
|
-
const
|
|
2421
|
+
const Ce = [
|
|
2418
2422
|
"incomingCall",
|
|
2419
2423
|
"declinedIncomingCall",
|
|
2420
2424
|
"terminatedIncomingCall",
|
|
2421
2425
|
"failedIncomingCall"
|
|
2422
|
-
],
|
|
2423
|
-
class
|
|
2426
|
+
], Ft = 486, kt = 487;
|
|
2427
|
+
class $t {
|
|
2424
2428
|
events;
|
|
2425
2429
|
incomingRTCSession;
|
|
2426
2430
|
connectionManager;
|
|
2427
2431
|
constructor(e) {
|
|
2428
|
-
this.connectionManager = e, this.events = new U(
|
|
2432
|
+
this.connectionManager = e, this.events = new U(Ce), this.start();
|
|
2429
2433
|
}
|
|
2430
2434
|
get remoteCallerData() {
|
|
2431
2435
|
return {
|
|
@@ -2455,7 +2459,7 @@ class Vt {
|
|
|
2455
2459
|
return this.removeIncomingSession(), e;
|
|
2456
2460
|
};
|
|
2457
2461
|
async declineToIncomingCall({
|
|
2458
|
-
statusCode: e =
|
|
2462
|
+
statusCode: e = kt
|
|
2459
2463
|
} = {}) {
|
|
2460
2464
|
return new Promise((t, s) => {
|
|
2461
2465
|
try {
|
|
@@ -2467,7 +2471,7 @@ class Vt {
|
|
|
2467
2471
|
});
|
|
2468
2472
|
}
|
|
2469
2473
|
async busyIncomingCall() {
|
|
2470
|
-
return this.declineToIncomingCall({ statusCode:
|
|
2474
|
+
return this.declineToIncomingCall({ statusCode: Ft });
|
|
2471
2475
|
}
|
|
2472
2476
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
2473
2477
|
on(e, t) {
|
|
@@ -2513,10 +2517,10 @@ class Vt {
|
|
|
2513
2517
|
}
|
|
2514
2518
|
const b = 1e3;
|
|
2515
2519
|
var E = /* @__PURE__ */ ((n) => (n.INBOUND_RTP = "inbound-rtp", n.REMOTE_OUTBOUND_RTP = "remote-outbound-rtp", n.MEDIA_SOURCE = "media-source", n.OUTBOUND_RTP = "outbound-rtp", n.REMOTE_INBOUND_RTP = "remote-inbound-rtp", n.CODEC = "codec", n.CANDIDATE_PAIR = "candidate-pair", n.CERTIFICATE = "certificate", n.TRANSPORT = "transport", n.LOCAL_CANDIDATE = "local-candidate", n.REMOTE_CANDIDATE = "remote-candidate", n))(E || {});
|
|
2516
|
-
const
|
|
2520
|
+
const Ee = ["collected"], X = () => "performance" in window ? performance.now() : Date.now(), L = (n) => [...n.keys()].reduce((e, t) => {
|
|
2517
2521
|
const s = n.get(t);
|
|
2518
2522
|
return s === void 0 ? e : { ...e, [s.type]: s };
|
|
2519
|
-
}, {}),
|
|
2523
|
+
}, {}), Vt = (n) => {
|
|
2520
2524
|
if (!n)
|
|
2521
2525
|
return {
|
|
2522
2526
|
outboundRtp: void 0,
|
|
@@ -2562,7 +2566,7 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
|
|
|
2562
2566
|
codec: t[E.CODEC],
|
|
2563
2567
|
synchronizationSources: e
|
|
2564
2568
|
};
|
|
2565
|
-
},
|
|
2569
|
+
}, qt = ({
|
|
2566
2570
|
audioReceiverStats: n,
|
|
2567
2571
|
synchronizationSourcesAudio: e
|
|
2568
2572
|
}) => {
|
|
@@ -2580,7 +2584,7 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
|
|
|
2580
2584
|
remoteOutboundRtp: t[E.REMOTE_OUTBOUND_RTP],
|
|
2581
2585
|
synchronizationSources: e
|
|
2582
2586
|
};
|
|
2583
|
-
},
|
|
2587
|
+
}, Ae = (n) => {
|
|
2584
2588
|
if (!n)
|
|
2585
2589
|
return {
|
|
2586
2590
|
candidatePair: void 0,
|
|
@@ -2597,18 +2601,18 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
|
|
|
2597
2601
|
remoteCandidate: e[E.REMOTE_CANDIDATE],
|
|
2598
2602
|
transport: e[E.TRANSPORT]
|
|
2599
2603
|
};
|
|
2600
|
-
},
|
|
2604
|
+
}, Wt = ({
|
|
2601
2605
|
audioSenderStats: n,
|
|
2602
2606
|
videoSenderFirstStats: e,
|
|
2603
2607
|
videoSenderSecondStats: t
|
|
2604
2608
|
}) => ({
|
|
2605
2609
|
video: J(e),
|
|
2606
2610
|
secondVideo: J(t),
|
|
2607
|
-
audio:
|
|
2608
|
-
additional:
|
|
2611
|
+
audio: Vt(n),
|
|
2612
|
+
additional: Ae(
|
|
2609
2613
|
n ?? e ?? t
|
|
2610
2614
|
)
|
|
2611
|
-
}),
|
|
2615
|
+
}), Ht = ({
|
|
2612
2616
|
audioReceiverStats: n,
|
|
2613
2617
|
videoReceiverFirstStats: e,
|
|
2614
2618
|
videoReceiverSecondStats: t,
|
|
@@ -2622,14 +2626,14 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
|
|
|
2622
2626
|
videoReceiversStats: t,
|
|
2623
2627
|
synchronizationSourcesVideo: s.video
|
|
2624
2628
|
}),
|
|
2625
|
-
audio:
|
|
2629
|
+
audio: qt({
|
|
2626
2630
|
audioReceiverStats: n,
|
|
2627
2631
|
synchronizationSourcesAudio: s.audio
|
|
2628
2632
|
}),
|
|
2629
|
-
additional:
|
|
2633
|
+
additional: Ae(
|
|
2630
2634
|
n ?? e ?? t
|
|
2631
2635
|
)
|
|
2632
|
-
}),
|
|
2636
|
+
}), xt = ({
|
|
2633
2637
|
audioSenderStats: n,
|
|
2634
2638
|
videoSenderFirstStats: e,
|
|
2635
2639
|
videoSenderSecondStats: t,
|
|
@@ -2638,11 +2642,11 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
|
|
|
2638
2642
|
videoReceiverSecondStats: r,
|
|
2639
2643
|
synchronizationSources: a
|
|
2640
2644
|
}) => {
|
|
2641
|
-
const o =
|
|
2645
|
+
const o = Wt({
|
|
2642
2646
|
audioSenderStats: n,
|
|
2643
2647
|
videoSenderFirstStats: e,
|
|
2644
2648
|
videoSenderSecondStats: t
|
|
2645
|
-
}), c =
|
|
2649
|
+
}), c = Ht({
|
|
2646
2650
|
audioReceiverStats: s,
|
|
2647
2651
|
videoReceiverFirstStats: i,
|
|
2648
2652
|
videoReceiverSecondStats: r,
|
|
@@ -2652,7 +2656,7 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
|
|
|
2652
2656
|
outbound: o,
|
|
2653
2657
|
inbound: c
|
|
2654
2658
|
};
|
|
2655
|
-
},
|
|
2659
|
+
}, Gt = async (n) => {
|
|
2656
2660
|
const e = "audio", t = "video", s = n.getSenders(), i = s.find((g) => g.track?.kind === e), r = s.filter((g) => g.track?.kind === t), a = n.getReceivers(), o = a.find((g) => g.track.kind === e), c = a.filter((g) => g.track.kind === t), h = {
|
|
2657
2661
|
trackIdentifier: o?.track.id,
|
|
2658
2662
|
item: o?.getSynchronizationSources()[0]
|
|
@@ -2689,22 +2693,22 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
|
|
|
2689
2693
|
videoReceiverSecondStats: $
|
|
2690
2694
|
};
|
|
2691
2695
|
});
|
|
2692
|
-
},
|
|
2696
|
+
}, Qt = (n) => {
|
|
2693
2697
|
d(String(n));
|
|
2694
2698
|
};
|
|
2695
|
-
class
|
|
2699
|
+
class Yt {
|
|
2696
2700
|
events;
|
|
2697
2701
|
setTimeoutRequest;
|
|
2698
|
-
requesterAllStatistics = new G(
|
|
2702
|
+
requesterAllStatistics = new G(Gt);
|
|
2699
2703
|
constructor() {
|
|
2700
|
-
this.events = new k(
|
|
2704
|
+
this.events = new k(Ee), this.setTimeoutRequest = new Z();
|
|
2701
2705
|
}
|
|
2702
2706
|
get requested() {
|
|
2703
2707
|
return this.setTimeoutRequest.requested;
|
|
2704
2708
|
}
|
|
2705
2709
|
start(e, {
|
|
2706
2710
|
interval: t = b,
|
|
2707
|
-
onError: s =
|
|
2711
|
+
onError: s = Qt
|
|
2708
2712
|
} = {}) {
|
|
2709
2713
|
this.stop(), this.setTimeoutRequest.request(() => {
|
|
2710
2714
|
this.collectStatistics(e, {
|
|
@@ -2735,7 +2739,7 @@ class zt {
|
|
|
2735
2739
|
}) => {
|
|
2736
2740
|
const s = X();
|
|
2737
2741
|
this.requesterAllStatistics.request(e).then((i) => {
|
|
2738
|
-
this.events.trigger("collected",
|
|
2742
|
+
this.events.trigger("collected", xt(i));
|
|
2739
2743
|
const a = X() - s;
|
|
2740
2744
|
let o = b;
|
|
2741
2745
|
a > 48 ? o = b * 4 : a > 32 ? o = b * 3 : a > 16 && (o = b * 2), this.start(e, {
|
|
@@ -2747,7 +2751,7 @@ class zt {
|
|
|
2747
2751
|
});
|
|
2748
2752
|
};
|
|
2749
2753
|
}
|
|
2750
|
-
class
|
|
2754
|
+
class zt {
|
|
2751
2755
|
availableIncomingBitrate;
|
|
2752
2756
|
statsPeerConnection;
|
|
2753
2757
|
callManager;
|
|
@@ -2757,7 +2761,7 @@ class Xt {
|
|
|
2757
2761
|
callManager: e,
|
|
2758
2762
|
apiManager: t
|
|
2759
2763
|
}) {
|
|
2760
|
-
this.callManager = e, this.apiManager = t, this.statsPeerConnection = new
|
|
2764
|
+
this.callManager = e, this.apiManager = t, this.statsPeerConnection = new Yt(), this.subscribe();
|
|
2761
2765
|
}
|
|
2762
2766
|
get events() {
|
|
2763
2767
|
return this.statsPeerConnection.events;
|
|
@@ -2799,26 +2803,26 @@ class Xt {
|
|
|
2799
2803
|
});
|
|
2800
2804
|
}
|
|
2801
2805
|
}
|
|
2802
|
-
const
|
|
2806
|
+
const Xt = (n, e) => n.filter((s) => e.some((i) => i.clockRate === s.clockRate && i.mimeType === s.mimeType && i.channels === s.channels && i.sdpFmtpLine === s.sdpFmtpLine)), Jt = (n) => {
|
|
2803
2807
|
const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs, i = t === null ? [] : t.codecs;
|
|
2804
|
-
return
|
|
2805
|
-
},
|
|
2808
|
+
return Xt(s, i);
|
|
2809
|
+
}, Kt = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
|
|
2806
2810
|
const i = e.indexOf(t.mimeType), r = e.indexOf(s.mimeType), a = i === -1 ? Number.MAX_VALUE : i, o = r === -1 ? Number.MAX_VALUE : r;
|
|
2807
2811
|
return a - o;
|
|
2808
|
-
}),
|
|
2812
|
+
}), jt = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), Zt = (n, {
|
|
2809
2813
|
preferredMimeTypesVideoCodecs: e,
|
|
2810
2814
|
excludeMimeTypesVideoCodecs: t
|
|
2811
2815
|
}) => {
|
|
2812
2816
|
try {
|
|
2813
2817
|
if (typeof n.setCodecPreferences == "function" && n.sender.track?.kind === "video" && (e !== void 0 && e.length > 0 || t !== void 0 && t.length > 0)) {
|
|
2814
|
-
const s =
|
|
2818
|
+
const s = Jt("video"), i = jt(s, t), r = Kt(i, e);
|
|
2815
2819
|
n.setCodecPreferences(r);
|
|
2816
2820
|
}
|
|
2817
2821
|
} catch (s) {
|
|
2818
2822
|
d("setCodecPreferences error", s);
|
|
2819
2823
|
}
|
|
2820
2824
|
};
|
|
2821
|
-
class
|
|
2825
|
+
class en {
|
|
2822
2826
|
/**
|
|
2823
2827
|
* Хранилище основных transceiver'ов
|
|
2824
2828
|
*/
|
|
@@ -2925,14 +2929,14 @@ class tn {
|
|
|
2925
2929
|
this.clear();
|
|
2926
2930
|
};
|
|
2927
2931
|
}
|
|
2928
|
-
const
|
|
2929
|
-
class
|
|
2932
|
+
const tn = (n) => [...n.keys()].map((e) => n.get(e)), nn = (n, e) => tn(n).find((t) => t?.type === e), sn = async (n) => n.getStats().then((e) => nn(e, "codec")?.mimeType);
|
|
2933
|
+
class rn {
|
|
2930
2934
|
// eslint-disable-next-line @typescript-eslint/class-methods-use-this
|
|
2931
2935
|
async getCodecFromSender(e) {
|
|
2932
|
-
return await
|
|
2936
|
+
return await sn(e) ?? "";
|
|
2933
2937
|
}
|
|
2934
2938
|
}
|
|
2935
|
-
class
|
|
2939
|
+
class an {
|
|
2936
2940
|
stackPromises = te({
|
|
2937
2941
|
noRunIsNotActual: !0
|
|
2938
2942
|
});
|
|
@@ -2957,11 +2961,11 @@ class on {
|
|
|
2957
2961
|
});
|
|
2958
2962
|
}
|
|
2959
2963
|
}
|
|
2960
|
-
class
|
|
2964
|
+
class on {
|
|
2961
2965
|
taskQueue;
|
|
2962
2966
|
onSetParameters;
|
|
2963
2967
|
constructor(e) {
|
|
2964
|
-
this.onSetParameters = e, this.taskQueue = new
|
|
2968
|
+
this.onSetParameters = e, this.taskQueue = new an();
|
|
2965
2969
|
}
|
|
2966
2970
|
async setEncodingsToSender(e, t) {
|
|
2967
2971
|
return this.taskQueue.add(async () => de(e, t, this.onSetParameters));
|
|
@@ -2970,17 +2974,17 @@ class cn {
|
|
|
2970
2974
|
this.taskQueue.stop();
|
|
2971
2975
|
}
|
|
2972
2976
|
}
|
|
2973
|
-
const
|
|
2974
|
-
const t =
|
|
2977
|
+
const Ne = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), cn = 1e6, M = (n) => n * cn, Re = M(0.06), Ie = M(4), dn = (n) => n <= 64 ? Re : n <= 128 ? M(0.12) : n <= 256 ? M(0.25) : n <= 384 ? M(0.32) : n <= 426 ? M(0.38) : n <= 640 ? M(0.5) : n <= 848 ? M(0.7) : n <= 1280 ? M(1) : n <= 1920 ? M(2) : Ie, hn = "av1", ln = (n) => Ne(n, hn), gn = 0.6, Y = (n, e) => ln(e) ? n * gn : n, un = (n) => Y(Re, n), Tn = (n) => Y(Ie, n), j = (n, e) => {
|
|
2978
|
+
const t = dn(n);
|
|
2975
2979
|
return Y(t, e);
|
|
2976
|
-
}, V = 1,
|
|
2980
|
+
}, V = 1, Sn = ({
|
|
2977
2981
|
videoTrack: n,
|
|
2978
2982
|
targetSize: e
|
|
2979
2983
|
}) => {
|
|
2980
2984
|
const t = n.getSettings(), s = t.width, i = t.height, r = s === void 0 ? V : s / e.width, a = i === void 0 ? V : i / e.height;
|
|
2981
2985
|
return Math.max(r, a, V);
|
|
2982
2986
|
};
|
|
2983
|
-
class
|
|
2987
|
+
class Cn {
|
|
2984
2988
|
ignoreForCodec;
|
|
2985
2989
|
senderFinder;
|
|
2986
2990
|
codecProvider;
|
|
@@ -3013,7 +3017,7 @@ class En {
|
|
|
3013
3017
|
if (!i?.track)
|
|
3014
3018
|
return { ...this.resultNoChanged, sender: i };
|
|
3015
3019
|
const r = await this.codecProvider.getCodecFromSender(i);
|
|
3016
|
-
if (
|
|
3020
|
+
if (Ne(r, this.ignoreForCodec))
|
|
3017
3021
|
return { ...this.resultNoChanged, sender: i };
|
|
3018
3022
|
const { mainCam: a, resolutionMainCam: o } = t ?? {};
|
|
3019
3023
|
return this.processSender(
|
|
@@ -3055,7 +3059,7 @@ class En {
|
|
|
3055
3059
|
async downgradeResolutionSender(e) {
|
|
3056
3060
|
const { sender: t, codec: s } = e, i = {
|
|
3057
3061
|
scaleResolutionDownBy: 200,
|
|
3058
|
-
maxBitrate:
|
|
3062
|
+
maxBitrate: un(s)
|
|
3059
3063
|
};
|
|
3060
3064
|
return this.parametersSetter.setEncodingsToSender(t, i);
|
|
3061
3065
|
}
|
|
@@ -3065,7 +3069,7 @@ class En {
|
|
|
3065
3069
|
* @returns Promise с результатом
|
|
3066
3070
|
*/
|
|
3067
3071
|
async setBitrateByTrackResolution(e) {
|
|
3068
|
-
const { sender: t, videoTrack: s, codec: i } = e, a = s.getSettings().width, o = a === void 0 ?
|
|
3072
|
+
const { sender: t, videoTrack: s, codec: i } = e, a = s.getSettings().width, o = a === void 0 ? Tn(i) : j(a, i);
|
|
3069
3073
|
return this.parametersSetter.setEncodingsToSender(t, {
|
|
3070
3074
|
scaleResolutionDownBy: 1,
|
|
3071
3075
|
maxBitrate: o
|
|
@@ -3081,7 +3085,7 @@ class En {
|
|
|
3081
3085
|
const [s, i] = e.split("x"), { sender: r, videoTrack: a, codec: o } = t, c = {
|
|
3082
3086
|
width: Number(s),
|
|
3083
3087
|
height: Number(i)
|
|
3084
|
-
}, h =
|
|
3088
|
+
}, h = Sn({
|
|
3085
3089
|
videoTrack: a,
|
|
3086
3090
|
targetSize: c
|
|
3087
3091
|
}), T = j(c.width, o), S = {
|
|
@@ -3091,14 +3095,14 @@ class En {
|
|
|
3091
3095
|
return this.parametersSetter.setEncodingsToSender(r, S);
|
|
3092
3096
|
}
|
|
3093
3097
|
}
|
|
3094
|
-
const
|
|
3095
|
-
class
|
|
3098
|
+
const En = (n) => n.find((e) => e.track?.kind === "video");
|
|
3099
|
+
class An {
|
|
3096
3100
|
// eslint-disable-next-line @typescript-eslint/class-methods-use-this
|
|
3097
3101
|
findVideoSender(e) {
|
|
3098
|
-
return
|
|
3102
|
+
return En(e);
|
|
3099
3103
|
}
|
|
3100
3104
|
}
|
|
3101
|
-
class
|
|
3105
|
+
class Nn {
|
|
3102
3106
|
currentSender;
|
|
3103
3107
|
originalReplaceTrack;
|
|
3104
3108
|
lastWidth;
|
|
@@ -3162,7 +3166,7 @@ class Rn {
|
|
|
3162
3166
|
this.setTimeoutRequest.cancelRequest(), this.lastWidth = void 0, this.lastHeight = void 0;
|
|
3163
3167
|
}
|
|
3164
3168
|
}
|
|
3165
|
-
class
|
|
3169
|
+
class Rn {
|
|
3166
3170
|
apiManager;
|
|
3167
3171
|
currentHandler;
|
|
3168
3172
|
constructor(e) {
|
|
@@ -3182,7 +3186,7 @@ class In {
|
|
|
3182
3186
|
this.currentHandler && (this.apiManager.off("main-cam-control", this.currentHandler), this.currentHandler = void 0);
|
|
3183
3187
|
}
|
|
3184
3188
|
}
|
|
3185
|
-
class
|
|
3189
|
+
class In {
|
|
3186
3190
|
eventHandler;
|
|
3187
3191
|
senderBalancer;
|
|
3188
3192
|
parametersSetterWithQueue;
|
|
@@ -3194,16 +3198,16 @@ class pn {
|
|
|
3194
3198
|
onSetParameters: i,
|
|
3195
3199
|
pollIntervalMs: r
|
|
3196
3200
|
} = {}) {
|
|
3197
|
-
this.getConnection = t, this.eventHandler = new
|
|
3201
|
+
this.getConnection = t, this.eventHandler = new Rn(e), this.parametersSetterWithQueue = new on(i), this.senderBalancer = new Cn(
|
|
3198
3202
|
{
|
|
3199
|
-
senderFinder: new
|
|
3200
|
-
codecProvider: new
|
|
3203
|
+
senderFinder: new An(),
|
|
3204
|
+
codecProvider: new rn(),
|
|
3201
3205
|
parametersSetter: this.parametersSetterWithQueue
|
|
3202
3206
|
},
|
|
3203
3207
|
{
|
|
3204
3208
|
ignoreForCodec: s
|
|
3205
3209
|
}
|
|
3206
|
-
), this.trackMonitor = new
|
|
3210
|
+
), this.trackMonitor = new Nn({ pollIntervalMs: r });
|
|
3207
3211
|
}
|
|
3208
3212
|
/**
|
|
3209
3213
|
* Подписывается на события управления главной камерой
|
|
@@ -3248,13 +3252,13 @@ class pn {
|
|
|
3248
3252
|
});
|
|
3249
3253
|
};
|
|
3250
3254
|
}
|
|
3251
|
-
const
|
|
3255
|
+
const pe = [
|
|
3252
3256
|
"balancing-scheduled",
|
|
3253
3257
|
"balancing-started",
|
|
3254
3258
|
"balancing-stopped",
|
|
3255
3259
|
"parameters-updated"
|
|
3256
3260
|
];
|
|
3257
|
-
class
|
|
3261
|
+
class pn {
|
|
3258
3262
|
isBalancingActive = !1;
|
|
3259
3263
|
events;
|
|
3260
3264
|
callManager;
|
|
@@ -3262,7 +3266,7 @@ class mn {
|
|
|
3262
3266
|
videoSendingBalancer;
|
|
3263
3267
|
startBalancingTimer;
|
|
3264
3268
|
constructor(e, t, s = {}) {
|
|
3265
|
-
this.events = new k(
|
|
3269
|
+
this.events = new k(pe), this.callManager = e, this.balancingStartDelay = s.balancingStartDelay ?? 1e4, this.videoSendingBalancer = new In(
|
|
3266
3270
|
t,
|
|
3267
3271
|
() => e.connection,
|
|
3268
3272
|
{
|
|
@@ -3332,17 +3336,17 @@ class mn {
|
|
|
3332
3336
|
this.startBalancingTimer && (clearTimeout(this.startBalancingTimer), this.startBalancingTimer = void 0);
|
|
3333
3337
|
}
|
|
3334
3338
|
}
|
|
3335
|
-
const
|
|
3339
|
+
const mn = 1e6, _n = Se.map((n) => `auto-connect:${n}`), Mn = ge.map((n) => `connection:${n}`), vn = ie.map((n) => `call:${n}`), fn = ne.map((n) => `api:${n}`), Pn = Ce.map((n) => `incoming-call:${n}`), On = he.map((n) => `presentation:${n}`), Dn = Ee.map((n) => `stats:${n}`), yn = pe.map((n) => `video-balancer:${n}`), bn = [
|
|
3340
|
+
..._n,
|
|
3336
3341
|
...Mn,
|
|
3337
3342
|
...vn,
|
|
3338
3343
|
...fn,
|
|
3339
3344
|
...Pn,
|
|
3340
3345
|
...On,
|
|
3341
3346
|
...Dn,
|
|
3342
|
-
...yn
|
|
3343
|
-
...bn
|
|
3347
|
+
...yn
|
|
3344
3348
|
];
|
|
3345
|
-
class
|
|
3349
|
+
class Gn {
|
|
3346
3350
|
events;
|
|
3347
3351
|
connectionManager;
|
|
3348
3352
|
connectionQueueManager;
|
|
@@ -3362,28 +3366,28 @@ class Yn {
|
|
|
3362
3366
|
videoBalancerOptions: i,
|
|
3363
3367
|
autoConnectorOptions: r
|
|
3364
3368
|
} = {}) {
|
|
3365
|
-
this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.events = new U(
|
|
3369
|
+
this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.events = new U(bn), this.connectionManager = new pt({ JsSIP: e }), this.connectionQueueManager = new mt({
|
|
3366
3370
|
connectionManager: this.connectionManager
|
|
3367
|
-
}), this.callManager = new
|
|
3371
|
+
}), this.callManager = new ze(), this.apiManager = new Fe({
|
|
3368
3372
|
connectionManager: this.connectionManager,
|
|
3369
3373
|
callManager: this.callManager
|
|
3370
|
-
}), this.incomingCallManager = new
|
|
3374
|
+
}), this.incomingCallManager = new $t(this.connectionManager), this.presentationManager = new dt({
|
|
3371
3375
|
callManager: this.callManager,
|
|
3372
|
-
maxBitrate:
|
|
3373
|
-
}), this.statsManager = new
|
|
3376
|
+
maxBitrate: mn
|
|
3377
|
+
}), this.statsManager = new zt({
|
|
3374
3378
|
callManager: this.callManager,
|
|
3375
3379
|
apiManager: this.apiManager
|
|
3376
|
-
}), this.autoConnectorManager = new
|
|
3380
|
+
}), this.autoConnectorManager = new Bt(
|
|
3377
3381
|
{
|
|
3378
3382
|
connectionQueueManager: this.connectionQueueManager,
|
|
3379
3383
|
connectionManager: this.connectionManager,
|
|
3380
3384
|
callManager: this.callManager
|
|
3381
3385
|
},
|
|
3382
3386
|
r
|
|
3383
|
-
), this.transceiverManager = new
|
|
3387
|
+
), this.transceiverManager = new en({
|
|
3384
3388
|
callManager: this.callManager,
|
|
3385
3389
|
apiManager: this.apiManager
|
|
3386
|
-
}), this.videoSendingBalancerManager = new
|
|
3390
|
+
}), this.videoSendingBalancerManager = new pn(
|
|
3387
3391
|
this.callManager,
|
|
3388
3392
|
this.apiManager,
|
|
3389
3393
|
i
|
|
@@ -3568,7 +3572,7 @@ class Yn {
|
|
|
3568
3572
|
return this.apiManager.askPermissionToEnableCam(...e);
|
|
3569
3573
|
}
|
|
3570
3574
|
setCodecPreferences(e) {
|
|
3571
|
-
|
|
3575
|
+
Zt(e, {
|
|
3572
3576
|
preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
|
|
3573
3577
|
excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
|
|
3574
3578
|
});
|
|
@@ -3589,20 +3593,19 @@ class Yn {
|
|
|
3589
3593
|
}
|
|
3590
3594
|
export {
|
|
3591
3595
|
ae as E,
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3596
|
+
ke as O,
|
|
3597
|
+
Gn as S,
|
|
3598
|
+
rt as a,
|
|
3599
|
+
Be as b,
|
|
3600
|
+
xn as c,
|
|
3601
|
+
Hn as d,
|
|
3602
|
+
Wn as e,
|
|
3599
3603
|
E as f,
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
Qn as j,
|
|
3604
|
+
Yt as g,
|
|
3605
|
+
Nt as h,
|
|
3606
|
+
sn as i,
|
|
3604
3607
|
d as l,
|
|
3605
3608
|
F as p,
|
|
3606
|
-
|
|
3609
|
+
It as r,
|
|
3607
3610
|
de as s
|
|
3608
3611
|
};
|