sip-connector 28.10.9 → 28.11.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/AutoConnectorManager/AutoConnectorStateMachine/createAutoConnectorMachine.d.ts +1 -1
- package/dist/CallReconnectManager/CallReconnectStateMachine/createCallReconnectMachine.d.ts +1 -1
- package/dist/SipConnector/@SipConnector.d.ts +4 -1
- package/dist/{SipConnector-C9qqnbrN.js → SipConnector-B7GSx5-W.js} +86 -55
- package/dist/SipConnector-MOMg0vX4.cjs +1 -0
- package/dist/SipConnectorFacade/@SipConnectorFacade.d.ts +3 -1
- package/dist/StatsManager/@StatsManager.d.ts +7 -0
- package/dist/StatsManager/constants.d.ts +1 -0
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -3
- package/package.json +9 -9
- package/dist/ApiManager/__tests-utils__/helpers.d.ts +0 -7
- package/dist/CallReconnectManager/__fixtures__/FakeCallManager.d.ts +0 -16
- package/dist/CallReconnectManager/__fixtures__/FakeConnectionManager.d.ts +0 -18
- package/dist/CallReconnectManager/__fixtures__/index.d.ts +0 -4
- package/dist/SipConnector-C1YzHhK7.cjs +0 -1
- package/dist/StatsPeerConnection/__fixtures__/callStaticsState.d.ts +0 -3931
- package/dist/VideoSendingBalancer/__fixtures__/createMockTrack.d.ts +0 -5
- package/dist/VideoSendingBalancer/__fixtures__/index.d.ts +0 -1
- package/dist/__mocks__/logger.d.ts +0 -4
- package/dist/demo/App.d.ts +0 -42
- package/dist/demo/CallStatsManager.d.ts +0 -21
- package/dist/demo/LoaderManager.d.ts +0 -29
- package/dist/demo/LocalMediaStreamManager/LocalMediaStreamManager.d.ts +0 -85
- package/dist/demo/LocalMediaStreamManager/events.d.ts +0 -16
- package/dist/demo/LocalMediaStreamManager/index.d.ts +0 -2
- package/dist/demo/LogsManager.d.ts +0 -26
- package/dist/demo/NotificationManager.d.ts +0 -16
- package/dist/demo/PresentationManager.d.ts +0 -37
- package/dist/demo/RemoteMediaStreamManager.d.ts +0 -53
- package/dist/demo/Session/RecvQualityManager.d.ts +0 -11
- package/dist/demo/Session/Session.d.ts +0 -33
- package/dist/demo/Session/index.d.ts +0 -2
- package/dist/demo/Session/parseIceServersFromServerConfig.d.ts +0 -3
- package/dist/demo/Session/resolveRequestSipServerIp.d.ts +0 -19
- package/dist/demo/Session/resolveServerParametersRequester.d.ts +0 -31
- package/dist/demo/Session/sipConnectorFacade.d.ts +0 -3
- package/dist/demo/Statuses.d.ts +0 -45
- package/dist/demo/StatusesRoot/Model.d.ts +0 -883
- package/dist/demo/StatusesRoot/__fixtures__/callStatesMock.d.ts +0 -102
- package/dist/demo/StatusesRoot/__tests__/Model.test.d.ts +0 -1
- package/dist/demo/StatusesRoot/__tests__/reaction.test.d.ts +0 -1
- package/dist/demo/StatusesRoot/autoConnector/Model.d.ts +0 -189
- package/dist/demo/StatusesRoot/autoConnector/__tests__/Model.test.d.ts +0 -1
- package/dist/demo/StatusesRoot/call/Model.d.ts +0 -90
- package/dist/demo/StatusesRoot/call/__tests__/Model.test.d.ts +0 -1
- package/dist/demo/StatusesRoot/call/__tests__/guards.test.d.ts +0 -1
- package/dist/demo/StatusesRoot/call/guards.d.ts +0 -17
- package/dist/demo/StatusesRoot/call/utils.d.ts +0 -9
- package/dist/demo/StatusesRoot/callReconnect/Model.d.ts +0 -256
- package/dist/demo/StatusesRoot/callReconnect/__tests__/Model.test.d.ts +0 -1
- package/dist/demo/StatusesRoot/callReconnect/__tests__/guards.test.d.ts +0 -1
- package/dist/demo/StatusesRoot/callReconnect/guards.d.ts +0 -10
- package/dist/demo/StatusesRoot/callSession/Model.d.ts +0 -37
- package/dist/demo/StatusesRoot/callSession/__tests__/Model.test.d.ts +0 -1
- package/dist/demo/StatusesRoot/connection/Model.d.ts +0 -88
- package/dist/demo/StatusesRoot/connection/__tests__/Model.test.d.ts +0 -1
- package/dist/demo/StatusesRoot/incoming/Model.d.ts +0 -83
- package/dist/demo/StatusesRoot/incoming/__tests__/Model.test.d.ts +0 -1
- package/dist/demo/StatusesRoot/index.d.ts +0 -3
- package/dist/demo/StatusesRoot/presentation/Model.d.ts +0 -55
- package/dist/demo/StatusesRoot/presentation/__tests__/Model.test.d.ts +0 -1
- package/dist/demo/StatusesRoot/system/Model.d.ts +0 -23
- package/dist/demo/StatusesRoot/system/__tests__/Model.test.d.ts +0 -1
- package/dist/demo/VideoPlayer.d.ts +0 -43
- package/dist/demo/__tests__/Statuses.test.d.ts +0 -1
- package/dist/demo/app/CallReconnectIndicatorPresenter.d.ts +0 -10
- package/dist/demo/app/DemoCallFlowPorts.d.ts +0 -53
- package/dist/demo/app/DemoCallFlowService.d.ts +0 -21
- package/dist/demo/app/DemoCallStatePresenter.d.ts +0 -21
- package/dist/demo/app/MainStreamHealthNotificationsBinder.d.ts +0 -23
- package/dist/demo/app/MainStreamRecoverySettingsApplier.d.ts +0 -20
- package/dist/demo/app/__tests__/DemoCallFlowService.test.d.ts +0 -1
- package/dist/demo/app/createDemoSession.d.ts +0 -2
- package/dist/demo/app/domUiHelpers.d.ts +0 -2
- package/dist/demo/app/inputParsing.d.ts +0 -12
- package/dist/demo/app/types.d.ts +0 -16
- package/dist/demo/dom.d.ts +0 -173
- package/dist/demo/index.d.ts +0 -0
- package/dist/demo/jsonRenderer.d.ts +0 -6
- package/dist/demo/logger.d.ts +0 -5
- package/dist/demo/state/FormState.d.ts +0 -72
- package/dist/demo/state/FormStateManager.d.ts +0 -73
- package/dist/demo/utils/getAppInfo.d.ts +0 -8
- package/dist/demo/utils/getBrowserInfo.d.ts +0 -8
- package/dist/demo/utils/getMediaStream.d.ts +0 -2
- package/dist/demo/utils/onUnloadPage.d.ts +0 -2
- package/dist/demo/utils/parseDisplayName.d.ts +0 -2
- package/dist/e2e/call.spec.d.ts +0 -1
- package/dist/e2e/connect.spec.d.ts +0 -1
- package/dist/e2e/connection.config.d.ts +0 -9
- package/dist/e2e/demo.spec.d.ts +0 -1
- package/dist/e2e/disconnect-during-connecting.spec.d.ts +0 -1
- package/dist/e2e/fixtures.d.ts +0 -10
- package/dist/e2e/page-objects/ConnectPage.d.ts +0 -92
- package/dist/e2e/page-objects/DemoPage.d.ts +0 -21
- package/dist/e2e/page-objects/StatusDashboard.d.ts +0 -53
- package/dist/e2e/ping-reconnect.spec.d.ts +0 -1
- package/dist/e2e/reconnect.spec.d.ts +0 -1
- package/dist/e2e/spectator.spec.d.ts +0 -1
- package/dist/e2e/support/networkControls.d.ts +0 -1
- package/dist/e2e/support/webSocketControls.d.ts +0 -4
- package/dist/e2e/types.d.ts +0 -19
- package/dist/eslint.config.d.ts +0 -2
- package/dist/jest.config.d.ts +0 -3
- package/dist/playwright.config.d.ts +0 -5
- package/dist/tools/__fixtures__/call.d.ts +0 -21
- package/dist/tools/__fixtures__/connectToServer.d.ts +0 -153
- package/dist/tools/__fixtures__/hasValidUri.d.ts +0 -3
- package/dist/tools/__fixtures__/permissions.d.ts +0 -8
- package/dist/tools/__fixtures__/processRequest.d.ts +0 -11
- package/dist/tools/__tests-utils__/parseObject.d.ts +0 -3
- package/dist/tools/__tests-utils__/resolveParseArray.d.ts +0 -2
- package/dist/vite.config.d.ts +0 -2
- package/dist/vite.demo.config.d.ts +0 -2
|
@@ -67,7 +67,7 @@ export declare const createAutoConnectorMachine: (deps: TAutoConnectorMachineDep
|
|
|
67
67
|
type: "TELEPHONY.RESULT";
|
|
68
68
|
outcome: "stillConnected";
|
|
69
69
|
}, {
|
|
70
|
-
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<void, import('
|
|
70
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<void, import('xstate').NonReducibleUnknown, import('xstate').EventObject> | import('xstate').PromiseActorLogic<void, import('..').TParametersAutoConnect | undefined, import('xstate').EventObject>> | undefined;
|
|
71
71
|
}, {
|
|
72
72
|
src: "connect";
|
|
73
73
|
logic: import('xstate').PromiseActorLogic<void, import('..').TParametersAutoConnect | undefined, import('xstate').EventObject>;
|
|
@@ -101,7 +101,7 @@ export declare const createCallReconnectMachine: (deps: TCallReconnectMachineDep
|
|
|
101
101
|
} | {
|
|
102
102
|
type: "CONN.DISCONNECTED";
|
|
103
103
|
}, {
|
|
104
|
-
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<void, import('xstate').NonReducibleUnknown, import('xstate').EventObject
|
|
104
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<void, import('xstate').NonReducibleUnknown, import('xstate').EventObject> | import('xstate').PromiseActorLogic<void, number, import('xstate').EventObject> | import('xstate').PromiseActorLogic<void, import('..').TCallRedialParameters | undefined, import('xstate').EventObject>> | undefined;
|
|
105
105
|
}, {
|
|
106
106
|
src: "delayBeforeAttempt";
|
|
107
107
|
logic: import('xstate').PromiseActorLogic<void, number, import('xstate').EventObject>;
|
|
@@ -91,7 +91,10 @@ declare class SipConnector extends EventEmitterProxy<TEventMap> {
|
|
|
91
91
|
getRecvQuality: CallManager['getRecvQuality'];
|
|
92
92
|
setRecvQuality: CallManager['setRecvQuality'];
|
|
93
93
|
applyQuality: CallManager['applyQuality'];
|
|
94
|
-
replaceMediaStream: CallManager[
|
|
94
|
+
replaceMediaStream: (mediaStream: Parameters<CallManager["replaceMediaStream"]>[0], options?: Parameters<CallManager["replaceMediaStream"]>[1] & {
|
|
95
|
+
waitForOutboundVideoPackets?: boolean;
|
|
96
|
+
waitForOutboundVideoPacketsTimeout?: number;
|
|
97
|
+
}) => Promise<void>;
|
|
95
98
|
startPresentation(mediaStream: MediaStream, options?: {
|
|
96
99
|
isNeedReinvite?: boolean;
|
|
97
100
|
contentHint?: TContentHint;
|
|
@@ -6711,7 +6711,7 @@ var uo = g("CallManager: CallStateMachine"), fo = class extends O {
|
|
|
6711
6711
|
if (t === void 0) throw Error("failed to collect statistics: peerConnection is not defined");
|
|
6712
6712
|
return this.requesterAllStatistics.request(t);
|
|
6713
6713
|
};
|
|
6714
|
-
}, Ec = g("StatsManager"),
|
|
6714
|
+
}, Ec = 5e3, Dc = g("StatsManager"), Oc = class extends e {
|
|
6715
6715
|
statsPeerConnection;
|
|
6716
6716
|
availableStats;
|
|
6717
6717
|
previousAvailableStats;
|
|
@@ -6783,10 +6783,35 @@ var uo = g("CallManager: CallStateMachine"), fo = class extends O {
|
|
|
6783
6783
|
let e = this.packetsReceived !== void 0 && this.packetsReceived >= 500, t = this.packetsReceived !== this.previousPacketsReceived;
|
|
6784
6784
|
return e && t;
|
|
6785
6785
|
}
|
|
6786
|
+
get outboundVideoMediaSourceTrackIdentifier() {
|
|
6787
|
+
return this.availableStats?.outbound.video.mediaSource?.trackIdentifier;
|
|
6788
|
+
}
|
|
6789
|
+
get outboundVideoPacketsSent() {
|
|
6790
|
+
return this.availableStats?.outbound.video.outboundRtp?.packetsSent;
|
|
6791
|
+
}
|
|
6792
|
+
get previousOutboundVideoPacketsSent() {
|
|
6793
|
+
return this.previousAvailableStats?.outbound.video.outboundRtp?.packetsSent;
|
|
6794
|
+
}
|
|
6795
|
+
async waitForOutboundVideoPackets(e, { timeout: t = Ec } = {}) {
|
|
6796
|
+
if (!this.isSendingOutboundVideoPacketsWithTrack(e)) return new Promise((n, r) => {
|
|
6797
|
+
let i, a, o = () => {
|
|
6798
|
+
clearTimeout(i), a();
|
|
6799
|
+
};
|
|
6800
|
+
i = setTimeout(() => {
|
|
6801
|
+
o(), r(/* @__PURE__ */ Error(`Timed out waiting for outbound-rtp packets with video track ${e}`));
|
|
6802
|
+
}, t), a = this.on("collected", () => {
|
|
6803
|
+
this.isSendingOutboundVideoPacketsWithTrack(e) && (o(), n());
|
|
6804
|
+
});
|
|
6805
|
+
});
|
|
6806
|
+
}
|
|
6786
6807
|
hasAvailableIncomingBitrateChangedQuarter() {
|
|
6787
6808
|
let e = this.previousAvailableIncomingBitrate, t = this.availableIncomingBitrate;
|
|
6788
6809
|
return e === void 0 || t === void 0 ? !1 : e === 0 ? t > 0 : Math.abs(t - e) / e >= .25;
|
|
6789
6810
|
}
|
|
6811
|
+
isSendingOutboundVideoPacketsWithTrack(e) {
|
|
6812
|
+
let t = this.outboundVideoMediaSourceTrackIdentifier === e, n = this.outboundVideoPacketsSent, r = this.previousOutboundVideoPacketsSent;
|
|
6813
|
+
return !t || n === void 0 || r === void 0 ? !1 : n > 0 && n !== r;
|
|
6814
|
+
}
|
|
6790
6815
|
subscribe() {
|
|
6791
6816
|
this.callManager.on("peerconnection:confirmed", this.start), this.callManager.on("recv-session-started", this.handleRecvSessionStarted), this.callManager.on("recv-session-ended", this.handleRecvSessionEnded), this.callManager.on("recv-quality-changed", this.handleRecvQualityChanged), this.callManager.on("failed", this.handleEnded), this.callManager.on("ended", this.handleEnded), this.statsPeerConnection.on("collected", this.handleStatsCollected);
|
|
6792
6817
|
}
|
|
@@ -6816,37 +6841,37 @@ var uo = g("CallManager: CallStateMachine"), fo = class extends O {
|
|
|
6816
6841
|
};
|
|
6817
6842
|
maybeSendStats() {
|
|
6818
6843
|
this.availableIncomingBitrate !== void 0 && this.hasAvailableIncomingBitrateChangedQuarter() && this.apiManager.sendStats({ availableIncomingBitrate: this.availableIncomingBitrate }).catch((e) => {
|
|
6819
|
-
|
|
6844
|
+
Dc("Failed to send stats", e);
|
|
6820
6845
|
});
|
|
6821
6846
|
}
|
|
6822
|
-
},
|
|
6847
|
+
}, kc = g("setCodecPreferences"), Ac = (e, t) => e.filter((e) => t.some((t) => t.clockRate === e.clockRate && t.mimeType === e.mimeType && t.channels === e.channels && t.sdpFmtpLine === e.sdpFmtpLine)), jc = (e) => {
|
|
6823
6848
|
let t = RTCRtpSender.getCapabilities(e), n = RTCRtpReceiver.getCapabilities(e);
|
|
6824
|
-
return
|
|
6825
|
-
},
|
|
6849
|
+
return Ac(t === null ? [] : t.codecs, n === null ? [] : n.codecs);
|
|
6850
|
+
}, Mc = (e, t) => t === void 0 || t.length === 0 ? e : e.sort((e, n) => {
|
|
6826
6851
|
let r = t.indexOf(e.mimeType), i = t.indexOf(n.mimeType);
|
|
6827
6852
|
return (r === -1 ? Number.MAX_VALUE : r) - (i === -1 ? Number.MAX_VALUE : i);
|
|
6828
|
-
}),
|
|
6853
|
+
}), Nc = (e, t) => t === void 0 || t.length === 0 ? e : e.filter((e) => !t.includes(e.mimeType)), Pc = (e, { preferredMimeTypesVideoCodecs: t, excludeMimeTypesVideoCodecs: n }) => {
|
|
6829
6854
|
try {
|
|
6830
6855
|
if (typeof e.setCodecPreferences == "function" && e.sender.track?.kind === "video" && (t !== void 0 && t.length > 0 || n !== void 0 && n.length > 0)) {
|
|
6831
|
-
let r =
|
|
6856
|
+
let r = Mc(Nc(jc("video"), n), t);
|
|
6832
6857
|
e.setCodecPreferences(r);
|
|
6833
6858
|
}
|
|
6834
6859
|
} catch (e) {
|
|
6835
|
-
|
|
6860
|
+
kc("setCodecPreferences error", e);
|
|
6836
6861
|
}
|
|
6837
|
-
},
|
|
6862
|
+
}, Fc = (e) => e.getVideoTracks()[0], Ic = [
|
|
6838
6863
|
"balancing-scheduled",
|
|
6839
6864
|
"balancing-started",
|
|
6840
6865
|
"balancing-stopped",
|
|
6841
6866
|
"parameters-updated"
|
|
6842
|
-
],
|
|
6867
|
+
], Lc = () => new n(Ic), Rc = g("VideoSendingBalancerManager"), zc = class extends e {
|
|
6843
6868
|
isBalancingActive = !1;
|
|
6844
6869
|
callManager;
|
|
6845
6870
|
balancingStartDelay;
|
|
6846
6871
|
videoSendingBalancer;
|
|
6847
6872
|
startBalancingTimer;
|
|
6848
6873
|
constructor(e, t, n = {}) {
|
|
6849
|
-
super(
|
|
6874
|
+
super(Lc()), this.callManager = e, this.balancingStartDelay = n.balancingStartDelay ?? 1e4, this.videoSendingBalancer = new Vo(t, () => e.connection, {
|
|
6850
6875
|
...n,
|
|
6851
6876
|
onSetParameters: (e) => {
|
|
6852
6877
|
this.events.trigger("parameters-updated", e), n.onSetParameters?.(e);
|
|
@@ -6886,27 +6911,27 @@ var uo = g("CallManager: CallStateMachine"), fo = class extends O {
|
|
|
6886
6911
|
scheduleBalancingStart() {
|
|
6887
6912
|
this.clearStartTimer(), this.startBalancingTimer = setTimeout(() => {
|
|
6888
6913
|
this.startBalancingTimer = void 0, this.startBalancing().catch((e) => {
|
|
6889
|
-
|
|
6914
|
+
Rc("startBalancing: error", e);
|
|
6890
6915
|
});
|
|
6891
6916
|
}, this.balancingStartDelay), this.events.trigger("balancing-scheduled", { delay: this.balancingStartDelay });
|
|
6892
6917
|
}
|
|
6893
6918
|
clearStartTimer() {
|
|
6894
6919
|
this.startBalancingTimer &&= (clearTimeout(this.startBalancingTimer), void 0);
|
|
6895
6920
|
}
|
|
6896
|
-
},
|
|
6897
|
-
Rc,
|
|
6898
|
-
zc,
|
|
6921
|
+
}, Bc = "health-snapshot", Vc = "inbound-video-problem-detected", Hc = "inbound-video-problem-resolved", Uc = "inbound-video-problem-reset", Wc = [
|
|
6899
6922
|
Bc,
|
|
6900
|
-
Vc
|
|
6901
|
-
|
|
6923
|
+
Vc,
|
|
6924
|
+
Hc,
|
|
6925
|
+
Uc
|
|
6926
|
+
], Gc = () => new n(Wc), Kc = 3, qc = class t extends e {
|
|
6902
6927
|
statsManager;
|
|
6903
6928
|
callManager;
|
|
6904
6929
|
minConsecutiveProblemSamplesCount;
|
|
6905
6930
|
consecutiveProblemSamplesCount = 0;
|
|
6906
6931
|
currentProblemReason;
|
|
6907
6932
|
hasEmittedCurrentProblem = !1;
|
|
6908
|
-
constructor(e, n, r =
|
|
6909
|
-
super(
|
|
6933
|
+
constructor(e, n, r = Kc) {
|
|
6934
|
+
super(Gc()), this.statsManager = e, this.callManager = n, t.assertValidMinConsecutiveProblemSamplesCount(r), this.minConsecutiveProblemSamplesCount = r, this.subscribe();
|
|
6910
6935
|
}
|
|
6911
6936
|
get mainVideoTrack() {
|
|
6912
6937
|
return this.callManager.getMainRemoteStream()?.getVideoTracks()[0];
|
|
@@ -6945,13 +6970,13 @@ var uo = g("CallManager: CallStateMachine"), fo = class extends O {
|
|
|
6945
6970
|
}
|
|
6946
6971
|
handleStatsCollected = () => {
|
|
6947
6972
|
let { healthSnapshot: e } = this;
|
|
6948
|
-
this.events.trigger(
|
|
6973
|
+
this.events.trigger(Bc, e);
|
|
6949
6974
|
let n = t.resolveProblemReason(e);
|
|
6950
6975
|
if (n === void 0) {
|
|
6951
6976
|
this.maybeEmitResolvedProblem(e), this.resetProblemDetectionState();
|
|
6952
6977
|
return;
|
|
6953
6978
|
}
|
|
6954
|
-
this.updateProblemDetectionState(n), this.consecutiveProblemSamplesCount >= this.minConsecutiveProblemSamplesCount && !this.hasEmittedCurrentProblem && (this.events.trigger(
|
|
6979
|
+
this.updateProblemDetectionState(n), this.consecutiveProblemSamplesCount >= this.minConsecutiveProblemSamplesCount && !this.hasEmittedCurrentProblem && (this.events.trigger(Vc, {
|
|
6955
6980
|
...e,
|
|
6956
6981
|
consecutiveProblemSamplesCount: this.consecutiveProblemSamplesCount,
|
|
6957
6982
|
reason: n
|
|
@@ -6968,7 +6993,7 @@ var uo = g("CallManager: CallStateMachine"), fo = class extends O {
|
|
|
6968
6993
|
this.currentProblemReason = e, this.consecutiveProblemSamplesCount = 1, this.hasEmittedCurrentProblem = !1;
|
|
6969
6994
|
};
|
|
6970
6995
|
maybeEmitResolvedProblem = (e) => {
|
|
6971
|
-
!this.hasEmittedCurrentProblem || this.currentProblemReason === void 0 || this.events.trigger(
|
|
6996
|
+
!this.hasEmittedCurrentProblem || this.currentProblemReason === void 0 || this.events.trigger(Hc, {
|
|
6972
6997
|
...e,
|
|
6973
6998
|
reason: this.currentProblemReason
|
|
6974
6999
|
});
|
|
@@ -6977,7 +7002,7 @@ var uo = g("CallManager: CallStateMachine"), fo = class extends O {
|
|
|
6977
7002
|
this.maybeEmitResetProblem(e), this.resetProblemDetectionState();
|
|
6978
7003
|
};
|
|
6979
7004
|
maybeEmitResetProblem = (e) => {
|
|
6980
|
-
!this.hasEmittedCurrentProblem || this.currentProblemReason === void 0 || this.events.trigger(
|
|
7005
|
+
!this.hasEmittedCurrentProblem || this.currentProblemReason === void 0 || this.events.trigger(Uc, {
|
|
6981
7006
|
reason: this.currentProblemReason,
|
|
6982
7007
|
resetCause: e
|
|
6983
7008
|
});
|
|
@@ -6985,11 +7010,11 @@ var uo = g("CallManager: CallStateMachine"), fo = class extends O {
|
|
|
6985
7010
|
resetProblemDetectionState = () => {
|
|
6986
7011
|
this.currentProblemReason = void 0, this.consecutiveProblemSamplesCount = 0, this.hasEmittedCurrentProblem = !1;
|
|
6987
7012
|
};
|
|
6988
|
-
},
|
|
7013
|
+
}, Jc = g("MainStreamRecovery"), Yc = 4e3, Xc = class e {
|
|
6989
7014
|
renegotiateRequester;
|
|
6990
7015
|
renegotiateThrottled;
|
|
6991
7016
|
callManager;
|
|
6992
|
-
constructor(e, t =
|
|
7017
|
+
constructor(e, t = Yc) {
|
|
6993
7018
|
this.callManager = e, this.renegotiateRequester = new c(e.renegotiate.bind(e)), this.renegotiateThrottled = this.createRenegotiateThrottled(t), this.subscribe();
|
|
6994
7019
|
}
|
|
6995
7020
|
static assertValidThrottleRecoveryTimeout(e) {
|
|
@@ -6999,17 +7024,17 @@ var uo = g("CallManager: CallStateMachine"), fo = class extends O {
|
|
|
6999
7024
|
e.assertValidThrottleRecoveryTimeout(t), this.renegotiateThrottled.cancel(), this.renegotiateThrottled = this.createRenegotiateThrottled(t);
|
|
7000
7025
|
}
|
|
7001
7026
|
recover() {
|
|
7002
|
-
|
|
7027
|
+
Jc("trying to recover main stream"), this.renegotiateThrottled();
|
|
7003
7028
|
}
|
|
7004
7029
|
requestRenegotiate = () => {
|
|
7005
|
-
if (
|
|
7006
|
-
|
|
7030
|
+
if (Jc("trying to renegotiate"), this.renegotiateRequester.requested) {
|
|
7031
|
+
Jc("previous renegotiate is not finished yet");
|
|
7007
7032
|
return;
|
|
7008
7033
|
}
|
|
7009
7034
|
this.renegotiateRequester.request().then(() => {
|
|
7010
|
-
|
|
7035
|
+
Jc("renegotiate has successful");
|
|
7011
7036
|
}).catch((e) => {
|
|
7012
|
-
|
|
7037
|
+
Jc("failed to renegotiate main media stream", e);
|
|
7013
7038
|
});
|
|
7014
7039
|
};
|
|
7015
7040
|
createRenegotiateThrottled(t) {
|
|
@@ -7021,31 +7046,29 @@ var uo = g("CallManager: CallStateMachine"), fo = class extends O {
|
|
|
7021
7046
|
});
|
|
7022
7047
|
}
|
|
7023
7048
|
cancel() {
|
|
7024
|
-
|
|
7049
|
+
Jc("cancel recover main stream"), this.renegotiateThrottled.cancel(), this.renegotiateRequester.cancelRequest();
|
|
7025
7050
|
}
|
|
7026
|
-
},
|
|
7051
|
+
}, Zc = /* @__PURE__ */ function(e) {
|
|
7027
7052
|
return e.VP8 = "video/VP8", e.VP9 = "video/VP9", e.H264 = "video/H264", e.AV1 = "video/AV1", e.rtx = "video/rtx", e.red = "video/red", e.flexfec03 = "video/flexfec-03", e;
|
|
7028
|
-
}({}),
|
|
7053
|
+
}({}), Qc = {
|
|
7029
7054
|
major: 25,
|
|
7030
7055
|
minor: 8,
|
|
7031
7056
|
patch: 0
|
|
7032
|
-
},
|
|
7033
|
-
let n = t(
|
|
7057
|
+
}, $c = ({ isYandexBrowser: e, hasGreaterThanBrowserVersion: t }) => {
|
|
7058
|
+
let n = t(Qc);
|
|
7034
7059
|
return e && n;
|
|
7035
|
-
},
|
|
7036
|
-
if (
|
|
7037
|
-
},
|
|
7060
|
+
}, el = () => {
|
|
7061
|
+
if ($c(Ki())) return [Zc.VP8];
|
|
7062
|
+
}, tl = () => {
|
|
7038
7063
|
let { isMobileDevice: e, isSafari: t, isOpera: n, isWindows: r } = Ki();
|
|
7039
7064
|
return e || t || n && r;
|
|
7040
|
-
},
|
|
7041
|
-
|
|
7042
|
-
var
|
|
7065
|
+
}, nl;
|
|
7066
|
+
tl() && (nl = "h264");
|
|
7067
|
+
var rl = { ignoreForCodec: nl }, il = el(), al = 1e6, ol = en.map((e) => `auto-connect:${e}`), sl = Bn.map((e) => `call-reconnect:${e}`), cl = xt.map((e) => `connection:${e}`), ll = vi.map((e) => `call:${e}`), ul = Ie.map((e) => `api:${e}`), dl = Bs.map((e) => `incoming-call:${e}`), fl = xs.map((e) => `presentation:${e}`), pl = uc.map((e) => `stats:${e}`), ml = Ic.map((e) => `video-balancer:${e}`), hl = Wc.map((e) => `main-stream-health:${e}`), gl = Qs.map((e) => `session:${e}`), _l = [
|
|
7043
7068
|
"disconnected-from-out-of-call",
|
|
7044
7069
|
"connected-with-configuration-from-out-of-call",
|
|
7045
7070
|
"stopped-presentation-by-server-command"
|
|
7046
|
-
],
|
|
7047
|
-
...il,
|
|
7048
|
-
...al,
|
|
7071
|
+
], vl = [
|
|
7049
7072
|
...ol,
|
|
7050
7073
|
...sl,
|
|
7051
7074
|
...cl,
|
|
@@ -7055,8 +7078,10 @@ var tl = { ignoreForCodec: el }, nl = Qc(), rl = 1e6, il = en.map((e) => `auto-c
|
|
|
7055
7078
|
...fl,
|
|
7056
7079
|
...pl,
|
|
7057
7080
|
...ml,
|
|
7058
|
-
...hl
|
|
7059
|
-
|
|
7081
|
+
...hl,
|
|
7082
|
+
...gl,
|
|
7083
|
+
..._l
|
|
7084
|
+
], yl = () => new n(vl), bl = g("SipConnector"), xl = class extends e {
|
|
7060
7085
|
connectionManager;
|
|
7061
7086
|
connectionQueueManager;
|
|
7062
7087
|
contentedStreamManager;
|
|
@@ -7076,10 +7101,10 @@ var tl = { ignoreForCodec: el }, nl = Qc(), rl = 1e6, il = en.map((e) => `auto-c
|
|
|
7076
7101
|
preferredMimeTypesVideoCodecs;
|
|
7077
7102
|
excludeMimeTypesVideoCodecs;
|
|
7078
7103
|
constructor({ JsSIP: e }, { preferredMimeTypesVideoCodecs: t, excludeMimeTypesVideoCodecs: n, videoBalancerOptions: r, autoConnectorOptions: i, callReconnectOptions: a, numberOfConnectionAttempts: o, minConsecutiveProblemSamplesCount: s, throttleRecoveryTimeout: c } = {}) {
|
|
7079
|
-
super(
|
|
7104
|
+
super(yl()), this.preferredMimeTypesVideoCodecs = t ?? il, this.excludeMimeTypesVideoCodecs = n, this.apiManager = new Ue(), this.connectionManager = new Pt({ JsSIP: e }, { numberOfConnectionAttempts: o }), this.connectionQueueManager = new Ft({ connectionManager: this.connectionManager }), this.contentedStreamManager = new zs(), this.callSessionState = new Bi(), this.callManager = new vs({ contentedStreamManager: this.contentedStreamManager }, { sendOffer: this.sendOffer }, { callSessionState: this.callSessionState }), this.incomingCallManager = new Xs(this.connectionManager), this.presentationManager = new Ns({
|
|
7080
7105
|
callManager: this.callManager,
|
|
7081
|
-
maxBitrate:
|
|
7082
|
-
}), this.statsManager = new
|
|
7106
|
+
maxBitrate: al
|
|
7107
|
+
}), this.statsManager = new Oc({
|
|
7083
7108
|
callManager: this.callManager,
|
|
7084
7109
|
apiManager: this.apiManager
|
|
7085
7110
|
}), this.autoConnectorManager = new pn({
|
|
@@ -7089,7 +7114,7 @@ var tl = { ignoreForCodec: el }, nl = Qc(), rl = 1e6, il = en.map((e) => `auto-c
|
|
|
7089
7114
|
}, i), this.callReconnectManager = new Un({
|
|
7090
7115
|
callManager: this.callManager,
|
|
7091
7116
|
connectionManager: this.connectionManager
|
|
7092
|
-
}, a), this.videoSendingBalancerManager = new
|
|
7117
|
+
}, a), this.videoSendingBalancerManager = new zc(this.callManager, this.apiManager, r ?? rl), this.mainStreamHealthMonitor = new qc(this.statsManager, this.callManager, s), this.mainStreamRecovery = new Xc(this.callManager, c), this.sessionManager = new rc({
|
|
7093
7118
|
connectionManager: this.connectionManager,
|
|
7094
7119
|
callManager: this.callManager,
|
|
7095
7120
|
incomingCallManager: this.incomingCallManager,
|
|
@@ -7199,7 +7224,13 @@ var tl = { ignoreForCodec: el }, nl = Qc(), rl = 1e6, il = en.map((e) => `auto-c
|
|
|
7199
7224
|
getRecvQuality = () => this.callManager.getRecvQuality();
|
|
7200
7225
|
setRecvQuality = async (e) => this.callManager.setRecvQuality(e);
|
|
7201
7226
|
applyQuality = async (e) => this.callManager.applyQuality(e);
|
|
7202
|
-
replaceMediaStream = async (
|
|
7227
|
+
replaceMediaStream = async (e, t) => {
|
|
7228
|
+
let { waitForOutboundVideoPackets: n, waitForOutboundVideoPacketsTimeout: r, ...i } = t ?? {};
|
|
7229
|
+
if (await this.callManager.replaceMediaStream(e, i), n !== !0) return;
|
|
7230
|
+
let a = Fc(e);
|
|
7231
|
+
if (a === void 0) throw Error("waitForOutboundVideoPackets requires a video track in mediaStream");
|
|
7232
|
+
await this.statsManager.waitForOutboundVideoPackets(a.id, { timeout: r });
|
|
7233
|
+
};
|
|
7203
7234
|
async startPresentation(e, t = {}) {
|
|
7204
7235
|
let { callLimit: n, onAddedTransceiver: r, ...i } = t;
|
|
7205
7236
|
return this.presentationManager.startPresentation(async () => {
|
|
@@ -7283,7 +7314,7 @@ var tl = { ignoreForCodec: el }, nl = Qc(), rl = 1e6, il = en.map((e) => `auto-c
|
|
|
7283
7314
|
t.body = e instanceof Error ? e.message : String(e);
|
|
7284
7315
|
let n = h.causes.INTERNAL_ERROR;
|
|
7285
7316
|
this.callManager.failed(t, n).catch((e) => {
|
|
7286
|
-
|
|
7317
|
+
bl("Failed to end call after failed:", e);
|
|
7287
7318
|
});
|
|
7288
7319
|
});
|
|
7289
7320
|
}
|
|
@@ -7300,7 +7331,7 @@ var tl = { ignoreForCodec: el }, nl = Qc(), rl = 1e6, il = en.map((e) => `auto-c
|
|
|
7300
7331
|
});
|
|
7301
7332
|
};
|
|
7302
7333
|
setCodecPreferences(e) {
|
|
7303
|
-
|
|
7334
|
+
Pc(e, {
|
|
7304
7335
|
preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
|
|
7305
7336
|
excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
|
|
7306
7337
|
});
|
|
@@ -7310,7 +7341,7 @@ var tl = { ignoreForCodec: el }, nl = Qc(), rl = 1e6, il = en.map((e) => `auto-c
|
|
|
7310
7341
|
}
|
|
7311
7342
|
subscribeToMainStreamHealthMonitorEvents() {
|
|
7312
7343
|
this.mainStreamHealthMonitor.on("inbound-video-problem-detected", ({ reason: e }) => {
|
|
7313
|
-
|
|
7344
|
+
bl("detected inbound video problem", { reason: e }), this.mainStreamRecovery.recover();
|
|
7314
7345
|
});
|
|
7315
7346
|
}
|
|
7316
7347
|
bridgeEvents = (e, t) => {
|
|
@@ -7325,4 +7356,4 @@ var tl = { ignoreForCodec: el }, nl = Qc(), rl = 1e6, il = en.map((e) => `auto-c
|
|
|
7325
7356
|
};
|
|
7326
7357
|
};
|
|
7327
7358
|
//#endregion
|
|
7328
|
-
export { Ai as A, F as B, da as C, Di as D, z as E, oi as F, A as G, St as H, Bn as I, ye as J, lt as K, Rn as L, xi as M, Ci as N, ji as O, yi as P, R, Wa as S, Ei as T, vt as U, ne as V, M as W, g as X, ve as Y, bs as _, $ as a, po as b, rc as c, Y as d, Vs as f, K as g, J as h, fc as i, Oi as j, ki as k, Ks as l, Os as m,
|
|
7359
|
+
export { Ai as A, F as B, da as C, Di as D, z as E, oi as F, A as G, St as H, Bn as I, ye as J, lt as K, Rn as L, xi as M, Ci as N, ji as O, yi as P, R, Wa as S, Ei as T, vt as U, ne as V, M as W, g as X, ve as Y, bs as _, $ as a, po as b, rc as c, Y as d, Vs as f, K as g, J as h, fc as i, Oi as j, ki as k, Ks as l, Os as m, Zc as n, cc as o, Ms as p, je as q, Tc as r, Q as s, xl as t, Z as u, W as v, Bi as w, V as x, go as y, Ut as z };
|