sip-connector 30.0.0 → 31.0.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/CallManager/MCUSession.d.ts +1 -0
- package/dist/CallManager/types.d.ts +3 -1
- package/dist/PresentationManager/@PresentationManager.d.ts +9 -23
- package/dist/PresentationManager/PresentationStateMachine/PresentationStateMachine.d.ts +17 -8
- package/dist/PresentationManager/PresentationStateMachine/constants.d.ts +6 -1
- package/dist/PresentationManager/PresentationStateMachine/createPresentationMachine.d.ts +15 -8
- package/dist/PresentationManager/PresentationStateMachine/createPresentationMachineSetup.d.ts +11 -8
- package/dist/PresentationManager/PresentationStateMachine/types.d.ts +18 -15
- package/dist/PresentationManager/PresentationTrackService.d.ts +10 -0
- package/dist/PresentationManager/errors.d.ts +8 -0
- package/dist/PresentationManager/events.d.ts +3 -1
- package/dist/PresentationManager/index.d.ts +1 -1
- package/dist/PresentationManager/orchestration/PresentationConcurrency.d.ts +15 -0
- package/dist/PresentationManager/orchestration/PresentationLifecycle.d.ts +41 -0
- package/dist/PresentationManager/orchestration/createCallManagerPort.d.ts +14 -0
- package/dist/PresentationManager/orchestration/index.d.ts +4 -0
- package/dist/SipConnector/@SipConnector.d.ts +5 -2
- package/dist/SipConnector/events.d.ts +2 -2
- package/dist/SipConnector-mR632hR0.cjs +1 -0
- package/dist/{SipConnector-CfalmMr_.js → SipConnector-uMUKPYrL.js} +818 -712
- package/dist/SipConnectorFacade/@SipConnectorFacade.d.ts +1 -1
- package/dist/SipConnectorFacade/types.d.ts +1 -1
- package/dist/VideoSendingBalancer/@VideoSendingBalancer.d.ts +2 -2
- package/dist/VideoSendingBalancer/SenderBalancer.d.ts +3 -0
- package/dist/VideoSendingBalancer/calcResolution/calcScaleResolutionDownBy.d.ts +2 -2
- package/dist/VideoSendingBalancer/types.d.ts +4 -1
- package/dist/VideoSendingBalancerManager/@VideoSendingBalancerManager.d.ts +1 -1
- package/dist/__fixtures__/BaseSession.mock.d.ts +0 -4
- package/dist/__fixtures__/RTCSessionMock.d.ts +0 -1
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/prepareMediaStream.d.ts +1 -1
- package/dist/{PresentationManager → tools}/resolveSendEncodings.d.ts +2 -2
- package/dist/tools/setVideoTrackContentHints.d.ts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils/peerConnection/PresentationBitrate.d.ts +5 -0
- package/dist/utils/peerConnection/addTransceiverStrategy.d.ts +3 -0
- package/dist/utils/peerConnection/applyContentHint.d.ts +2 -0
- package/dist/utils/peerConnection/applySenderParams.d.ts +2 -0
- package/dist/utils/peerConnection/findSenderByTrack.d.ts +2 -0
- package/dist/utils/peerConnection/getSenderByKindTrack.d.ts +2 -0
- package/dist/utils/peerConnection/getSendersByKind.d.ts +5 -0
- package/dist/utils/peerConnection/index.d.ts +14 -0
- package/dist/utils/peerConnection/isFirefoxOrLower.d.ts +2 -0
- package/dist/utils/peerConnection/recvOnlySenderStrategy.d.ts +3 -0
- package/dist/utils/peerConnection/replaceMediaStream.d.ts +19 -0
- package/dist/utils/peerConnection/replaceTrackStrategy.d.ts +2 -0
- package/dist/utils/peerConnection/transceiverDirection.d.ts +1 -0
- package/dist/utils/peerConnection/types.d.ts +10 -0
- package/package.json +3 -3
- package/dist/PresentationManager/PresentationSenders.d.ts +0 -9
- package/dist/PresentationManager/presentationSession.d.ts +0 -11
- package/dist/PresentationManager/types.d.ts +0 -6
- package/dist/SipConnector-DZCNPWr4.cjs +0 -1
- /package/dist/utils/{findSenderByStream.d.ts → peerConnection/findSenderByStream.d.ts} +0 -0
- /package/dist/utils/{findVideoSender.d.ts → peerConnection/findVideoSender.d.ts} +0 -0
- /package/dist/utils/{findVideoTrack.d.ts → peerConnection/findVideoTrack.d.ts} +0 -0
- /package/dist/utils/{getCodecFromSender.d.ts → peerConnection/getCodecFromSender.d.ts} +0 -0
|
@@ -7,6 +7,7 @@ export declare class MCUSession implements IMCUSession {
|
|
|
7
7
|
protected rtcSession?: RTCSession;
|
|
8
8
|
private readonly disposers;
|
|
9
9
|
private pcConfig?;
|
|
10
|
+
private localMediaStream?;
|
|
10
11
|
private readonly bitrateStateManager;
|
|
11
12
|
constructor(events: TEvents);
|
|
12
13
|
get connection(): RTCPeerConnection | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RTCSession, UA } from '@krivega/jssip';
|
|
2
|
-
import { TContentHint } from '../
|
|
2
|
+
import { TContentHint } from '../utils/peerConnection';
|
|
3
3
|
import { Originator } from './events';
|
|
4
4
|
import { RemoteStreamsManager } from './RemoteStreamsManager';
|
|
5
5
|
export type TOnAddedTransceiver = (transceiver: RTCRtpTransceiver, track: MediaStreamTrack) => Promise<void>;
|
|
@@ -38,6 +38,8 @@ export type TCallConfig = {
|
|
|
38
38
|
};
|
|
39
39
|
export type TStartCall = (ua: UA, getUri: TGetUri, params: TParamsCall) => Promise<RTCPeerConnection>;
|
|
40
40
|
export type TReplaceMediaStream = (mediaStream: MediaStream, options?: {
|
|
41
|
+
directionVideo?: RTCRtpTransceiverDirection;
|
|
42
|
+
directionAudio?: RTCRtpTransceiverDirection;
|
|
41
43
|
deleteExisting?: boolean;
|
|
42
44
|
addMissing?: boolean;
|
|
43
45
|
forceRenegotiation?: boolean;
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { EventEmitterProxy } from 'events-constructor';
|
|
2
2
|
import { PresentationStateMachine } from './PresentationStateMachine';
|
|
3
3
|
import { CallManager } from '../CallManager';
|
|
4
|
+
import { TResolutionSize } from '../types';
|
|
5
|
+
import { TContentHint, TOnAddedTransceiver } from '../utils/peerConnection';
|
|
4
6
|
import { TEventMap } from './events';
|
|
5
|
-
import { TContentHint, TMaxResolution, TOnAddedTransceiver } from './types';
|
|
6
7
|
type TPresentationOptions = {
|
|
7
8
|
isNeedReinvite?: boolean;
|
|
8
9
|
contentHint?: TContentHint;
|
|
9
10
|
sendEncodings?: RTCRtpEncodingParameters[];
|
|
10
|
-
maxResolution?:
|
|
11
|
+
maxResolution?: TResolutionSize;
|
|
11
12
|
onAddedTransceiver?: TOnAddedTransceiver;
|
|
12
13
|
};
|
|
13
14
|
export declare const hasCanceledStartPresentationError: (error: unknown) => error is import('repeated-calls').TCanceledError<unknown>;
|
|
14
15
|
declare class PresentationManager extends EventEmitterProxy<TEventMap> {
|
|
15
16
|
readonly stateMachine: PresentationStateMachine;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
private readonly
|
|
20
|
-
private readonly presentationSenders;
|
|
21
|
-
private cancelableSendPresentationWithRepeatedCalls;
|
|
22
|
-
private readonly callManager;
|
|
17
|
+
private readonly trackService;
|
|
18
|
+
private readonly concurrency;
|
|
19
|
+
private readonly lifecycle;
|
|
20
|
+
private readonly sessionPort;
|
|
23
21
|
constructor({ callManager, maxBitrate, }: {
|
|
24
22
|
callManager: CallManager;
|
|
25
23
|
maxBitrate?: number;
|
|
@@ -32,20 +30,8 @@ declare class PresentationManager extends EventEmitterProxy<TEventMap> {
|
|
|
32
30
|
stopPresentation(beforeStopPresentation: () => Promise<void>): Promise<MediaStreamVideoTrack | undefined>;
|
|
33
31
|
updatePresentation(beforeStartPresentation: () => Promise<void>, videoTrack: MediaStreamVideoTrack, { contentHint, sendEncodings, maxResolution, onAddedTransceiver }?: TPresentationOptions): Promise<MediaStreamVideoTrack | undefined>;
|
|
34
32
|
cancelSendPresentationWithRepeatedCalls(): void;
|
|
35
|
-
private
|
|
36
|
-
private
|
|
37
|
-
private sendPresentation;
|
|
38
|
-
private executeStartPresentation;
|
|
39
|
-
private executeStopPresentation;
|
|
40
|
-
private readonly setMaxBitrate;
|
|
41
|
-
private readonly getRtcSessionProtected;
|
|
42
|
-
private readonly getConnectionProtected;
|
|
43
|
-
private readonly handleEnded;
|
|
33
|
+
private getStopVideoTrack;
|
|
34
|
+
private readonly handleCallEnded;
|
|
44
35
|
private reset;
|
|
45
|
-
private resetPresentationState;
|
|
46
|
-
private resetPresentation;
|
|
47
|
-
private removeVideoTrackPresentationCurrent;
|
|
48
|
-
private emitPresentationEvent;
|
|
49
|
-
private notifyPresentationFailed;
|
|
50
36
|
}
|
|
51
37
|
export default PresentationManager;
|
|
@@ -4,19 +4,20 @@ import { TCallEvents } from '../../CallManager';
|
|
|
4
4
|
import { TEvents as TPresentationEvents } from '../events';
|
|
5
5
|
import { TContext, TContextMap, TPresentationMachineEvents } from './types';
|
|
6
6
|
declare const presentationMachine: import('xstate').StateMachine<{
|
|
7
|
-
lastError: undefined;
|
|
8
|
-
} | {
|
|
9
|
-
lastError: undefined;
|
|
10
|
-
} | {
|
|
11
|
-
lastError: undefined;
|
|
12
|
-
} | {
|
|
13
|
-
lastError: undefined;
|
|
14
|
-
} | {
|
|
15
7
|
lastError: Error | undefined;
|
|
8
|
+
videoTrack: MediaStreamVideoTrack | undefined;
|
|
16
9
|
}, {
|
|
17
10
|
type: EEvents.SCREEN_STARTING;
|
|
11
|
+
videoTrack?: MediaStreamVideoTrack;
|
|
18
12
|
} | {
|
|
19
13
|
type: EEvents.SCREEN_STARTED;
|
|
14
|
+
videoTrack?: MediaStreamVideoTrack;
|
|
15
|
+
} | {
|
|
16
|
+
type: EEvents.SCREEN_UPDATING;
|
|
17
|
+
videoTrack: MediaStreamVideoTrack;
|
|
18
|
+
} | {
|
|
19
|
+
type: EEvents.SCREEN_UPDATED;
|
|
20
|
+
videoTrack: MediaStreamVideoTrack;
|
|
20
21
|
} | {
|
|
21
22
|
type: EEvents.SCREEN_ENDING;
|
|
22
23
|
} | {
|
|
@@ -49,6 +50,12 @@ declare const presentationMachine: import('xstate').StateMachine<{
|
|
|
49
50
|
} | {
|
|
50
51
|
type: import("./constants").EAction.CLEAR_ERROR;
|
|
51
52
|
params: import('xstate').NonReducibleUnknown;
|
|
53
|
+
} | {
|
|
54
|
+
type: import("./constants").EAction.SET_VIDEO_TRACK;
|
|
55
|
+
params: import('xstate').NonReducibleUnknown;
|
|
56
|
+
} | {
|
|
57
|
+
type: import("./constants").EAction.CLEAR_VIDEO_TRACK;
|
|
58
|
+
params: import('xstate').NonReducibleUnknown;
|
|
52
59
|
}, never, never, EState, string, import('xstate').NonReducibleUnknown, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, {
|
|
53
60
|
id: "presentation";
|
|
54
61
|
states: {
|
|
@@ -85,6 +92,8 @@ export declare class PresentationStateMachine extends BaseStateMachine<typeof pr
|
|
|
85
92
|
get isPending(): boolean;
|
|
86
93
|
get isActiveOrPending(): boolean;
|
|
87
94
|
get lastError(): Error | undefined;
|
|
95
|
+
get activeVideoTrack(): MediaStreamVideoTrack | undefined;
|
|
96
|
+
get pendingVideoTrack(): MediaStreamVideoTrack | undefined;
|
|
88
97
|
reset(): void;
|
|
89
98
|
send(event: TPresentationMachineEvents): void;
|
|
90
99
|
private hasState;
|
|
@@ -9,11 +9,15 @@ export declare enum EAction {
|
|
|
9
9
|
LOG_TRANSITION = "logTransition",
|
|
10
10
|
LOG_STATE_CHANGE = "logStateChange",
|
|
11
11
|
SET_ERROR = "setError",
|
|
12
|
-
CLEAR_ERROR = "clearError"
|
|
12
|
+
CLEAR_ERROR = "clearError",
|
|
13
|
+
SET_VIDEO_TRACK = "setVideoTrack",
|
|
14
|
+
CLEAR_VIDEO_TRACK = "clearVideoTrack"
|
|
13
15
|
}
|
|
14
16
|
export declare enum EEvents {
|
|
15
17
|
SCREEN_STARTING = "SCREEN.STARTING",
|
|
16
18
|
SCREEN_STARTED = "SCREEN.STARTED",
|
|
19
|
+
SCREEN_UPDATING = "SCREEN.UPDATING",
|
|
20
|
+
SCREEN_UPDATED = "SCREEN.UPDATED",
|
|
17
21
|
SCREEN_ENDING = "SCREEN.ENDING",
|
|
18
22
|
SCREEN_ENDED = "SCREEN.ENDED",
|
|
19
23
|
SCREEN_FAILED = "SCREEN.FAILED",
|
|
@@ -23,4 +27,5 @@ export declare enum EEvents {
|
|
|
23
27
|
}
|
|
24
28
|
export declare const initialContext: {
|
|
25
29
|
lastError: undefined;
|
|
30
|
+
videoTrack: undefined;
|
|
26
31
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { EAction, EEvents, EState } from './constants';
|
|
2
2
|
export declare const createPresentationMachine: () => import('xstate').StateMachine<{
|
|
3
|
-
lastError: undefined;
|
|
4
|
-
} | {
|
|
5
|
-
lastError: undefined;
|
|
6
|
-
} | {
|
|
7
|
-
lastError: undefined;
|
|
8
|
-
} | {
|
|
9
|
-
lastError: undefined;
|
|
10
|
-
} | {
|
|
11
3
|
lastError: Error | undefined;
|
|
4
|
+
videoTrack: MediaStreamVideoTrack | undefined;
|
|
12
5
|
}, {
|
|
13
6
|
type: EEvents.SCREEN_STARTING;
|
|
7
|
+
videoTrack?: MediaStreamVideoTrack;
|
|
14
8
|
} | {
|
|
15
9
|
type: EEvents.SCREEN_STARTED;
|
|
10
|
+
videoTrack?: MediaStreamVideoTrack;
|
|
11
|
+
} | {
|
|
12
|
+
type: EEvents.SCREEN_UPDATING;
|
|
13
|
+
videoTrack: MediaStreamVideoTrack;
|
|
14
|
+
} | {
|
|
15
|
+
type: EEvents.SCREEN_UPDATED;
|
|
16
|
+
videoTrack: MediaStreamVideoTrack;
|
|
16
17
|
} | {
|
|
17
18
|
type: EEvents.SCREEN_ENDING;
|
|
18
19
|
} | {
|
|
@@ -45,6 +46,12 @@ export declare const createPresentationMachine: () => import('xstate').StateMach
|
|
|
45
46
|
} | {
|
|
46
47
|
type: EAction.CLEAR_ERROR;
|
|
47
48
|
params: import('xstate').NonReducibleUnknown;
|
|
49
|
+
} | {
|
|
50
|
+
type: EAction.SET_VIDEO_TRACK;
|
|
51
|
+
params: import('xstate').NonReducibleUnknown;
|
|
52
|
+
} | {
|
|
53
|
+
type: EAction.CLEAR_VIDEO_TRACK;
|
|
54
|
+
params: import('xstate').NonReducibleUnknown;
|
|
48
55
|
}, never, never, EState, string, import('xstate').NonReducibleUnknown, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, {
|
|
49
56
|
id: "presentation";
|
|
50
57
|
states: {
|
package/dist/PresentationManager/PresentationStateMachine/createPresentationMachineSetup.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
export declare const createPresentationMachineSetup: () => import('xstate').SetupReturn<{
|
|
2
|
-
lastError: undefined;
|
|
3
|
-
} | {
|
|
4
|
-
lastError: undefined;
|
|
5
|
-
} | {
|
|
6
|
-
lastError: undefined;
|
|
7
|
-
} | {
|
|
8
|
-
lastError: undefined;
|
|
9
|
-
} | {
|
|
10
2
|
lastError: Error | undefined;
|
|
3
|
+
videoTrack: MediaStreamVideoTrack | undefined;
|
|
11
4
|
}, {
|
|
12
5
|
type: import("./constants").EEvents.SCREEN_STARTING;
|
|
6
|
+
videoTrack?: MediaStreamVideoTrack;
|
|
13
7
|
} | {
|
|
14
8
|
type: import("./constants").EEvents.SCREEN_STARTED;
|
|
9
|
+
videoTrack?: MediaStreamVideoTrack;
|
|
10
|
+
} | {
|
|
11
|
+
type: import("./constants").EEvents.SCREEN_UPDATING;
|
|
12
|
+
videoTrack: MediaStreamVideoTrack;
|
|
13
|
+
} | {
|
|
14
|
+
type: import("./constants").EEvents.SCREEN_UPDATED;
|
|
15
|
+
videoTrack: MediaStreamVideoTrack;
|
|
15
16
|
} | {
|
|
16
17
|
type: import("./constants").EEvents.SCREEN_ENDING;
|
|
17
18
|
} | {
|
|
@@ -37,4 +38,6 @@ export declare const createPresentationMachineSetup: () => import('xstate').Setu
|
|
|
37
38
|
};
|
|
38
39
|
setError: import('xstate').NonReducibleUnknown;
|
|
39
40
|
clearError: import('xstate').NonReducibleUnknown;
|
|
41
|
+
setVideoTrack: import('xstate').NonReducibleUnknown;
|
|
42
|
+
clearVideoTrack: import('xstate').NonReducibleUnknown;
|
|
40
43
|
}, {}, never, string, import('xstate').NonReducibleUnknown, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject>;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { EEvents, EState } from './constants';
|
|
2
|
+
type TPresentationContextBase = {
|
|
3
|
+
lastError: Error | undefined;
|
|
4
|
+
videoTrack: MediaStreamVideoTrack | undefined;
|
|
5
|
+
};
|
|
2
6
|
export type TPresentationMachineEvents = {
|
|
3
7
|
type: EEvents.SCREEN_STARTING;
|
|
8
|
+
videoTrack?: MediaStreamVideoTrack;
|
|
4
9
|
} | {
|
|
5
10
|
type: EEvents.SCREEN_STARTED;
|
|
11
|
+
videoTrack?: MediaStreamVideoTrack;
|
|
12
|
+
} | {
|
|
13
|
+
type: EEvents.SCREEN_UPDATING;
|
|
14
|
+
videoTrack: MediaStreamVideoTrack;
|
|
15
|
+
} | {
|
|
16
|
+
type: EEvents.SCREEN_UPDATED;
|
|
17
|
+
videoTrack: MediaStreamVideoTrack;
|
|
6
18
|
} | {
|
|
7
19
|
type: EEvents.SCREEN_ENDING;
|
|
8
20
|
} | {
|
|
@@ -19,20 +31,11 @@ export type TPresentationMachineEvents = {
|
|
|
19
31
|
type: EEvents.PRESENTATION_RESET;
|
|
20
32
|
};
|
|
21
33
|
export type TContextMap = {
|
|
22
|
-
[EState.IDLE]:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
[EState.
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
[EState.ACTIVE]: {
|
|
29
|
-
lastError: undefined;
|
|
30
|
-
};
|
|
31
|
-
[EState.STOPPING]: {
|
|
32
|
-
lastError: undefined;
|
|
33
|
-
};
|
|
34
|
-
[EState.FAILED]: {
|
|
35
|
-
lastError: Error | undefined;
|
|
36
|
-
};
|
|
34
|
+
[EState.IDLE]: TPresentationContextBase;
|
|
35
|
+
[EState.STARTING]: TPresentationContextBase;
|
|
36
|
+
[EState.ACTIVE]: TPresentationContextBase;
|
|
37
|
+
[EState.STOPPING]: TPresentationContextBase;
|
|
38
|
+
[EState.FAILED]: TPresentationContextBase;
|
|
37
39
|
};
|
|
38
40
|
export type TContext = TContextMap[keyof TContextMap];
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TTransceiverOptions } from '../utils/peerConnection';
|
|
2
|
+
declare class PresentationTrackService {
|
|
3
|
+
private readonly senders;
|
|
4
|
+
addOrReplace(connection: RTCPeerConnection, videoTrack: MediaStreamVideoTrack, options?: TTransceiverOptions): Promise<void>;
|
|
5
|
+
stop(connection: RTCPeerConnection): void;
|
|
6
|
+
clear(): void;
|
|
7
|
+
private getFromConnection;
|
|
8
|
+
private markTrack;
|
|
9
|
+
}
|
|
10
|
+
export default PresentationTrackService;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { TypedEvents } from 'events-constructor';
|
|
2
|
-
export declare const EVENT_NAMES: readonly ["start", "started", "end", "ended", "failed"];
|
|
2
|
+
export declare const EVENT_NAMES: readonly ["start", "started", "updating", "updated", "end", "ended", "failed"];
|
|
3
3
|
export type TEventMap = {
|
|
4
4
|
start: MediaStreamVideoTrack;
|
|
5
5
|
started: MediaStreamVideoTrack;
|
|
6
|
+
updating: MediaStreamVideoTrack;
|
|
7
|
+
updated: MediaStreamVideoTrack;
|
|
6
8
|
end: MediaStreamVideoTrack;
|
|
7
9
|
ended: MediaStreamVideoTrack;
|
|
8
10
|
failed: Error;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { hasCanceledStartPresentationError, default as PresentationManager, } from './@PresentationManager';
|
|
2
2
|
export { EPresentationStatus, PresentationStateMachine, EPresentationStateMachineEvents, } from './PresentationStateMachine';
|
|
3
3
|
export { EVENT_NAMES as PRESENTATION_MANAGER_EVENT_NAMES, createEvents } from './events';
|
|
4
|
+
export { PresentationReinviteError, PresentationTrackError } from './errors';
|
|
4
5
|
export type { TPresentationSnapshot, TPresentationContextMap } from './PresentationStateMachine';
|
|
5
6
|
export type { TEventMap as TPresentationManagerEventMap } from './events';
|
|
6
|
-
export type { TContentHint, TOnAddedTransceiver } from './types';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class PresentationConcurrency {
|
|
2
|
+
private promisePendingStart?;
|
|
3
|
+
private promisePendingStop?;
|
|
4
|
+
private cancelableSendPresentation?;
|
|
5
|
+
get isPending(): boolean;
|
|
6
|
+
cancel(): void;
|
|
7
|
+
runWithRepeatedCalls(targetFunction: () => Promise<MediaStreamVideoTrack>, isComplete: () => boolean, options?: {
|
|
8
|
+
callLimit: number;
|
|
9
|
+
}): Promise<MediaStreamVideoTrack>;
|
|
10
|
+
runStart(operation: () => Promise<MediaStreamVideoTrack>): Promise<MediaStreamVideoTrack>;
|
|
11
|
+
awaitPendingStart(): Promise<void>;
|
|
12
|
+
runStop(operation: () => Promise<MediaStreamVideoTrack | undefined>): Promise<MediaStreamVideoTrack | undefined>;
|
|
13
|
+
clearPending(): void;
|
|
14
|
+
reset(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TResolutionSize } from '../../types';
|
|
2
|
+
import { TContentHint, TOnAddedTransceiver } from '../../utils/peerConnection';
|
|
3
|
+
import { TEvents } from '../events';
|
|
4
|
+
import { TPresentationSessionPort } from './createCallManagerPort';
|
|
5
|
+
import { PresentationStateMachine } from '../PresentationStateMachine';
|
|
6
|
+
import { default as PresentationTrackService } from '../PresentationTrackService';
|
|
7
|
+
type TPresentationLifecycleDeps = {
|
|
8
|
+
events: TEvents;
|
|
9
|
+
trackService: PresentationTrackService;
|
|
10
|
+
sessionPort: TPresentationSessionPort;
|
|
11
|
+
stateMachine: PresentationStateMachine;
|
|
12
|
+
maxBitrate?: number;
|
|
13
|
+
};
|
|
14
|
+
type TPresentationFlowOptions = {
|
|
15
|
+
contentHint?: TContentHint;
|
|
16
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
17
|
+
maxResolution?: TResolutionSize;
|
|
18
|
+
onAddedTransceiver?: TOnAddedTransceiver;
|
|
19
|
+
degradationPreference?: RTCDegradationPreference;
|
|
20
|
+
isNeedReinvite?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare class PresentationLifecycle {
|
|
23
|
+
private readonly events;
|
|
24
|
+
private readonly trackService;
|
|
25
|
+
private readonly sessionPort;
|
|
26
|
+
private readonly stateMachine;
|
|
27
|
+
private readonly maxBitrate?;
|
|
28
|
+
constructor({ events, trackService, sessionPort, stateMachine, maxBitrate, }: TPresentationLifecycleDeps);
|
|
29
|
+
guardEstablishedSession(): void;
|
|
30
|
+
getConnectionProtected(): RTCPeerConnection;
|
|
31
|
+
executeStartFlow(beforeStartPresentation: () => Promise<void>, videoTrack: MediaStreamVideoTrack, { isNeedReinvite, contentHint, degradationPreference, sendEncodings, maxResolution, onAddedTransceiver, }: TPresentationFlowOptions): Promise<MediaStreamVideoTrack>;
|
|
32
|
+
executeUpdateFlow(beforeStartPresentation: () => Promise<void>, videoTrack: MediaStreamVideoTrack, { contentHint, degradationPreference, sendEncodings, maxResolution, onAddedTransceiver, }: TPresentationFlowOptions): Promise<MediaStreamVideoTrack>;
|
|
33
|
+
executeStop(videoTrack: MediaStreamVideoTrack): Promise<MediaStreamVideoTrack>;
|
|
34
|
+
emitEndedOnly(videoTrack: MediaStreamVideoTrack): void;
|
|
35
|
+
resetTrackService(): void;
|
|
36
|
+
private attachTrack;
|
|
37
|
+
private replaceActiveTrack;
|
|
38
|
+
private applyMaxBitrate;
|
|
39
|
+
private notifyFailed;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RTCSession } from '@krivega/jssip';
|
|
2
|
+
export type TPresentationSessionPort = {
|
|
3
|
+
getConnection: () => RTCPeerConnection | undefined;
|
|
4
|
+
getEstablishedSession: () => RTCSession | undefined;
|
|
5
|
+
renegotiate: () => Promise<boolean>;
|
|
6
|
+
onCallEnded: (handler: () => void) => () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const createCallManagerPort: (callManager: {
|
|
9
|
+
connection: RTCPeerConnection | undefined;
|
|
10
|
+
getEstablishedRTCSession: () => RTCSession | undefined;
|
|
11
|
+
renegotiate: () => Promise<boolean>;
|
|
12
|
+
on: (event: "failed" | "ended", handler: () => void) => void;
|
|
13
|
+
off: (event: "failed" | "ended", handler: () => void) => void;
|
|
14
|
+
}) => TPresentationSessionPort;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createCallManagerPort } from './createCallManagerPort';
|
|
2
|
+
export type { TPresentationSessionPort } from './createCallManagerPort';
|
|
3
|
+
export { PresentationConcurrency } from './PresentationConcurrency';
|
|
4
|
+
export { PresentationLifecycle } from './PresentationLifecycle';
|
|
@@ -7,13 +7,14 @@ import { ConnectionManager } from '../ConnectionManager';
|
|
|
7
7
|
import { ConnectionQueueManager } from '../ConnectionQueueManager';
|
|
8
8
|
import { ContentedStreamManager } from '../ContentedStreamManager';
|
|
9
9
|
import { IncomingCallManager } from '../IncomingCallManager';
|
|
10
|
-
import { PresentationManager
|
|
10
|
+
import { PresentationManager } from '../PresentationManager';
|
|
11
11
|
import { SessionManager } from '../SessionManager';
|
|
12
12
|
import { StatsManager, TOutboundVideoVerificationStrictness } from '../StatsManager';
|
|
13
13
|
import { VideoSendingBalancerManager } from '../VideoSendingBalancerManager';
|
|
14
14
|
import { MainStreamHealthMonitor } from '../MainStreamHealthMonitor';
|
|
15
15
|
import { TConnectAndCallSessionParameters, TConnectAndCallSessionResult } from '../ConnectAndCallSession';
|
|
16
16
|
import { TJsSIP } from '../types';
|
|
17
|
+
import { TContentHint, TOnAddedTransceiver } from '../utils/peerConnection';
|
|
17
18
|
import { IBalancerOptions } from '../VideoSendingBalancer';
|
|
18
19
|
import { TEventMap } from './events';
|
|
19
20
|
declare class SipConnector extends EventEmitterProxy<TEventMap> {
|
|
@@ -41,7 +42,7 @@ declare class SipConnector extends EventEmitterProxy<TEventMap> {
|
|
|
41
42
|
}, { preferredMimeTypesVideoCodecs, excludeMimeTypesVideoCodecs, videoBalancerOptions, autoConnectorOptions, callReconnectOptions, numberOfConnectionAttempts, minConsecutiveProblemSamplesCount, throttleRecoveryTimeout, }?: {
|
|
42
43
|
preferredMimeTypesVideoCodecs?: string[];
|
|
43
44
|
excludeMimeTypesVideoCodecs?: string[];
|
|
44
|
-
videoBalancerOptions?: IBalancerOptions
|
|
45
|
+
videoBalancerOptions?: Omit<IBalancerOptions, 'getMaxResolution'>;
|
|
45
46
|
autoConnectorOptions?: IAutoConnectorOptions;
|
|
46
47
|
callReconnectOptions?: ICallReconnectOptions;
|
|
47
48
|
numberOfConnectionAttempts?: number;
|
|
@@ -152,5 +153,7 @@ declare class SipConnector extends EventEmitterProxy<TEventMap> {
|
|
|
152
153
|
private subscribeToMainStreamHealthMonitorEvents;
|
|
153
154
|
private readonly bridgeEvents;
|
|
154
155
|
private readonly resolveHandleAddTransceiver;
|
|
156
|
+
private getMaxAvailableResolution;
|
|
157
|
+
private readonly resolveMainStreamSendEncodings;
|
|
155
158
|
}
|
|
156
159
|
export default SipConnector;
|
|
@@ -10,7 +10,7 @@ import { TPresentationManagerEventMap } from '../PresentationManager';
|
|
|
10
10
|
import { TSessionManagerEventMap } from '../SessionManager';
|
|
11
11
|
import { TStatsManagerEventMap } from '../StatsManager';
|
|
12
12
|
import { TVideoSendingBalancerManagerEventMap } from '../VideoSendingBalancerManager';
|
|
13
|
-
export declare const EVENT_NAMES: readonly [...("connection:connecting" | "connection:connected" | "connection:registered" | "connection:disconnecting" | "connection:disconnected" | "
|
|
13
|
+
export declare const EVENT_NAMES: readonly [...("connection:connecting" | "connection:connected" | "connection:registered" | "connection:disconnecting" | "connection:disconnected" | "auto-connect:failed-all-attempts" | "auto-connect:stop-attempts-by-error" | "auto-connect:limit-reached-attempts" | "auto-connect:before-attempt" | "auto-connect:success" | "auto-connect:cancelled-attempts" | "auto-connect:changed-attempt-status" | "auto-connect:telephony-check-failure" | "auto-connect:telephony-check-escalated" | "call-reconnect:cancelled" | "call-reconnect:armed" | "call-reconnect:limit-reached" | "call-reconnect:disarmed" | "call-reconnect:failure-detected" | "call-reconnect:attempt-scheduled" | "call-reconnect:attempt-started" | "call-reconnect:attempt-succeeded" | "call-reconnect:attempt-failed" | "call-reconnect:waiting-signaling" | "call-reconnect:status-changed" | "call-reconnect:termination-classified" | "call-reconnect:terminal" | "connection:newRTCSession" | "connection:unregistered" | "connection:registrationFailed" | "connection:newMessage" | "connection:sipEvent" | "connection:connect-started" | "connection:connect-succeeded" | "connection:connect-failed" | "connection:connect-parameters-resolve-success" | "connection:connect-parameters-resolve-failed" | "connection:connected-with-configuration" | "call:sdp" | "call:connecting" | "call:failed" | "call:call-status-changed" | "call:peerconnection" | "call:sending" | "call:progress" | "call:accepted" | "call:confirmed" | "call:ended" | "call:newDTMF" | "call:newInfo" | "call:hold" | "call:unhold" | "call:muted" | "call:unmuted" | "call:reinvite" | "call:update" | "call:refer" | "call:replaces" | "call:icecandidate" | "call:getusermediafailed" | "call:peerconnection:createofferfailed" | "call:peerconnection:createanswerfailed" | "call:peerconnection:setlocaldescriptionfailed" | "call:peerconnection:setremotedescriptionfailed" | "call:start-call" | "call:end-call" | "call:peerconnection:confirmed" | "call:peerconnection:ontrack" | "call:ended:fromserver" | "call:remote-tracks-changed" | "call:remote-streams-changed" | "call:recv-session-started" | "call:recv-session-ended" | "call:recv-quality-changed" | "api:enter-room" | "api:main-cam-control" | "api:use-license" | "api:new-dtmf" | "api:conference:participant-token-issued" | "api:contented-stream:available" | "api:contented-stream:not-available" | "api:presentation:must-stop" | "api:channels:all" | "api:channels:notify" | "api:participant:added-to-list-moderators" | "api:participant:removed-from-list-moderators" | "api:participant:move-request-to-stream" | "api:participant:move-request-to-spectators" | "api:participant:move-request-to-spectators-synthetic" | "api:participant:move-request-to-spectators-with-audio-id" | "api:participant:move-request-to-participants" | "api:participation:accepting-word-request" | "api:participation:cancelling-word-request" | "api:webcast:started" | "api:webcast:stopped" | "api:account:changed" | "api:account:deleted" | "api:admin:start-main-cam" | "api:admin:stop-main-cam" | "api:admin:start-mic" | "api:admin:stop-mic" | "api:admin:force-sync-media-state" | "api:failed-send-room-direct-p2p" | "incoming-call:ringing" | "incoming-call:declinedIncomingCall" | "incoming-call:terminatedIncomingCall" | "incoming-call:failedIncomingCall" | "presentation:start" | "presentation:failed" | "presentation:started" | "presentation:ended" | "presentation:updating" | "presentation:updated" | "presentation:end" | "stats:stopped" | "stats:collected" | "video-balancer:balancing-scheduled" | "video-balancer:balancing-started" | "video-balancer:balancing-stopped" | "video-balancer:parameters-updated" | "main-stream-health:health-snapshot" | "main-stream-health:inbound-video-problem-detected" | "main-stream-health:inbound-video-problem-resolved" | "main-stream-health:inbound-video-problem-reset" | "session:snapshot-changed")[], "disconnected-from-out-of-call", "connected-with-configuration-from-out-of-call", "stopped-presentation-by-server-command"];
|
|
14
14
|
export type TEventName = (typeof EVENT_NAMES)[number];
|
|
15
15
|
type PrefixedEventMap<T extends Record<string, unknown>, Prefix extends string> = {
|
|
16
16
|
[K in keyof T as `${Prefix}:${string & K}`]: T[K];
|
|
@@ -22,5 +22,5 @@ type TSipConnectorEventMap = {
|
|
|
22
22
|
};
|
|
23
23
|
export type TEventMap = PrefixedEventMap<TAutoConnectorManagerEventMap, 'auto-connect'> & PrefixedEventMap<TCallReconnectManagerEventMap, 'call-reconnect'> & PrefixedEventMap<TConnectionManagerEventMap, 'connection'> & PrefixedEventMap<TCallManagerEventMap, 'call'> & PrefixedEventMap<TApiManagerEventMap, 'api'> & PrefixedEventMap<TIncomingCallManagerEventMap, 'incoming-call'> & PrefixedEventMap<TPresentationManagerEventMap, 'presentation'> & PrefixedEventMap<TStatsManagerEventMap, 'stats'> & PrefixedEventMap<TVideoSendingBalancerManagerEventMap, 'video-balancer'> & PrefixedEventMap<TMainStreamHealthMonitorEventMap, 'main-stream-health'> & PrefixedEventMap<TSessionManagerEventMap, 'session'> & TSipConnectorEventMap;
|
|
24
24
|
export type TEvents = TypedEvents<TEventMap>;
|
|
25
|
-
export declare const createEvents: () => TypedEvents<TEventMap, readonly ("connection:connecting" | "connection:connected" | "connection:registered" | "connection:disconnecting" | "connection:disconnected" | "
|
|
25
|
+
export declare const createEvents: () => TypedEvents<TEventMap, readonly ("connection:connecting" | "connection:connected" | "connection:registered" | "connection:disconnecting" | "connection:disconnected" | "auto-connect:failed-all-attempts" | "auto-connect:stop-attempts-by-error" | "auto-connect:limit-reached-attempts" | "auto-connect:before-attempt" | "auto-connect:success" | "auto-connect:cancelled-attempts" | "auto-connect:changed-attempt-status" | "auto-connect:telephony-check-failure" | "auto-connect:telephony-check-escalated" | "call-reconnect:cancelled" | "call-reconnect:armed" | "call-reconnect:limit-reached" | "call-reconnect:disarmed" | "call-reconnect:failure-detected" | "call-reconnect:attempt-scheduled" | "call-reconnect:attempt-started" | "call-reconnect:attempt-succeeded" | "call-reconnect:attempt-failed" | "call-reconnect:waiting-signaling" | "call-reconnect:status-changed" | "call-reconnect:termination-classified" | "call-reconnect:terminal" | "connection:newRTCSession" | "connection:unregistered" | "connection:registrationFailed" | "connection:newMessage" | "connection:sipEvent" | "connection:connect-started" | "connection:connect-succeeded" | "connection:connect-failed" | "connection:connect-parameters-resolve-success" | "connection:connect-parameters-resolve-failed" | "connection:connected-with-configuration" | "call:sdp" | "call:connecting" | "call:failed" | "call:call-status-changed" | "call:peerconnection" | "call:sending" | "call:progress" | "call:accepted" | "call:confirmed" | "call:ended" | "call:newDTMF" | "call:newInfo" | "call:hold" | "call:unhold" | "call:muted" | "call:unmuted" | "call:reinvite" | "call:update" | "call:refer" | "call:replaces" | "call:icecandidate" | "call:getusermediafailed" | "call:peerconnection:createofferfailed" | "call:peerconnection:createanswerfailed" | "call:peerconnection:setlocaldescriptionfailed" | "call:peerconnection:setremotedescriptionfailed" | "call:start-call" | "call:end-call" | "call:peerconnection:confirmed" | "call:peerconnection:ontrack" | "call:ended:fromserver" | "call:remote-tracks-changed" | "call:remote-streams-changed" | "call:recv-session-started" | "call:recv-session-ended" | "call:recv-quality-changed" | "api:enter-room" | "api:main-cam-control" | "api:use-license" | "api:new-dtmf" | "api:conference:participant-token-issued" | "api:contented-stream:available" | "api:contented-stream:not-available" | "api:presentation:must-stop" | "api:channels:all" | "api:channels:notify" | "api:participant:added-to-list-moderators" | "api:participant:removed-from-list-moderators" | "api:participant:move-request-to-stream" | "api:participant:move-request-to-spectators" | "api:participant:move-request-to-spectators-synthetic" | "api:participant:move-request-to-spectators-with-audio-id" | "api:participant:move-request-to-participants" | "api:participation:accepting-word-request" | "api:participation:cancelling-word-request" | "api:webcast:started" | "api:webcast:stopped" | "api:account:changed" | "api:account:deleted" | "api:admin:start-main-cam" | "api:admin:stop-main-cam" | "api:admin:start-mic" | "api:admin:stop-mic" | "api:admin:force-sync-media-state" | "api:failed-send-room-direct-p2p" | "incoming-call:ringing" | "incoming-call:declinedIncomingCall" | "incoming-call:terminatedIncomingCall" | "incoming-call:failedIncomingCall" | "presentation:start" | "presentation:failed" | "presentation:started" | "presentation:ended" | "presentation:updating" | "presentation:updated" | "presentation:end" | "stats:stopped" | "stats:collected" | "video-balancer:balancing-scheduled" | "video-balancer:balancing-started" | "video-balancer:balancing-stopped" | "video-balancer:parameters-updated" | "main-stream-health:health-snapshot" | "main-stream-health:inbound-video-problem-detected" | "main-stream-health:inbound-video-problem-resolved" | "main-stream-health:inbound-video-problem-reset" | "session:snapshot-changed" | keyof TSipConnectorEventMap)[]>;
|
|
26
26
|
export {};
|