@vkontakte/calls-sdk 2.8.11-dev.f204132b.0 → 2.8.11-dev.fdf6f999.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/CallsSDK.d.ts +14 -9
- package/abstract/BaseSignaling.d.ts +4 -3
- package/calls-sdk.cjs.js +11 -9
- package/calls-sdk.esm.js +5589 -5199
- package/classes/Conversation.d.ts +13 -11
- package/classes/ConversationResponseValidator.d.ts +3 -0
- package/classes/MediaSource.d.ts +0 -7
- package/classes/SpecListener.d.ts +0 -2
- package/classes/stat/StatFirstMediaReceived.d.ts +2 -1
- package/classes/transport/DirectTransport.d.ts +10 -0
- package/classes/transport/ServerTransport.d.ts +14 -0
- package/classes/transport/Transport.d.ts +20 -1
- package/default/Signaling.d.ts +29 -45
- package/default/SignalingTransport.d.ts +68 -0
- package/enums/HangupType.d.ts +2 -1
- package/enums/SignalingNotification.d.ts +1 -2
- package/package.json +1 -1
- package/static/DebugVideoStats.d.ts +37 -0
- package/static/External.d.ts +76 -143
- package/static/Params.d.ts +87 -83
- package/types/SignalingMessage.d.ts +1 -4
- package/types/Statistics.d.ts +4 -0
- package/types/VideoStreamDebug.d.ts +5 -0
- package/types/WebTransport.d.ts +4 -0
- package/classes/CallRegistry.d.ts +0 -22
- package/static/Capabilities.d.ts +0 -5
- package/types/Capabilities.d.ts +0 -24
|
@@ -16,7 +16,7 @@ import { ConversationData, ConversationOnStartParams } from '../types/Conversati
|
|
|
16
16
|
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
|
|
17
17
|
import type { FastJoinHandler } from '../types/FastJoin';
|
|
18
18
|
import MediaModifiers from '../types/MediaModifiers';
|
|
19
|
-
import
|
|
19
|
+
import { IVideoDimentions } from '../types/MediaSettings';
|
|
20
20
|
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
21
21
|
import MuteStates from '../types/MuteStates';
|
|
22
22
|
import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../types/Participant';
|
|
@@ -37,7 +37,6 @@ export default class Conversation extends EventEmitter {
|
|
|
37
37
|
private _conversation;
|
|
38
38
|
private _myLastRequestedLayouts;
|
|
39
39
|
private _state;
|
|
40
|
-
private _previousState;
|
|
41
40
|
private _participantState;
|
|
42
41
|
private _participants;
|
|
43
42
|
private _pendingParticipants;
|
|
@@ -53,8 +52,10 @@ export default class Conversation extends EventEmitter {
|
|
|
53
52
|
private _isRealTimeAsrRequested;
|
|
54
53
|
private _serverSettings;
|
|
55
54
|
private _serverTimeOffset;
|
|
56
|
-
private
|
|
57
|
-
private
|
|
55
|
+
private static _current;
|
|
56
|
+
private static _activationMutex;
|
|
57
|
+
private static _delayedHangup;
|
|
58
|
+
private static _abortController;
|
|
58
59
|
private readonly _onUnload;
|
|
59
60
|
private readonly _audioOutput;
|
|
60
61
|
private readonly _stats;
|
|
@@ -63,6 +64,8 @@ export default class Conversation extends EventEmitter {
|
|
|
63
64
|
private _audioFix;
|
|
64
65
|
private _streamByStreamId;
|
|
65
66
|
private _streamIdByStreamDescription;
|
|
67
|
+
private _participantIdByDebugStreamId;
|
|
68
|
+
private _mediaTypeByDebugStreamId;
|
|
66
69
|
private _streamWaitTimerByStreamDescription;
|
|
67
70
|
private _sequenceNumberByStreamDescription;
|
|
68
71
|
private _cooldownTimestampByStreamDescription;
|
|
@@ -72,10 +75,6 @@ export default class Conversation extends EventEmitter {
|
|
|
72
75
|
static current(): Conversation | null;
|
|
73
76
|
static hangupAfterInit(): void;
|
|
74
77
|
static id(): string | null;
|
|
75
|
-
get id(): string;
|
|
76
|
-
get externalId(): ExternalParticipantId | undefined;
|
|
77
|
-
get mediaSettings(): MediaSettings | undefined;
|
|
78
|
-
get isCallHeld(): boolean;
|
|
79
78
|
static debugSessionId(): string | null;
|
|
80
79
|
static getSyncedTime(): number;
|
|
81
80
|
get debugSessionId(): string | null;
|
|
@@ -227,6 +226,8 @@ export default class Conversation extends EventEmitter {
|
|
|
227
226
|
private _sendUpdateDisplayLayout;
|
|
228
227
|
private _cleanupCooldownQueue;
|
|
229
228
|
private _onParticipantSourcesUpdate;
|
|
229
|
+
private _clearVideoStreamDebugParticipant;
|
|
230
|
+
private _registerVideoStreamDebugParticipant;
|
|
230
231
|
private _onParticipantPromoted;
|
|
231
232
|
private _onChatRoomUpdated;
|
|
232
233
|
private _onSharedMovieUpdate;
|
|
@@ -355,6 +356,7 @@ export default class Conversation extends EventEmitter {
|
|
|
355
356
|
private _onOptionsChanged;
|
|
356
357
|
private _onNetworkStatus;
|
|
357
358
|
private _onRemoteStreamSecond;
|
|
359
|
+
private _onDataChannelScreenStreamDebug;
|
|
358
360
|
/**
|
|
359
361
|
* Коллбек, вызывающийся при получении/остановке стрима от AnimojiReceiver
|
|
360
362
|
* @param participantId - участник, к которому относится стрим
|
|
@@ -382,6 +384,9 @@ export default class Conversation extends EventEmitter {
|
|
|
382
384
|
private _onAudioMixStall;
|
|
383
385
|
private _onRemoteSignalledStall;
|
|
384
386
|
private _onRemoteDataStats;
|
|
387
|
+
private _onVideoStreamDebug;
|
|
388
|
+
private _resolveVideoStreamDebugMediaType;
|
|
389
|
+
private _resolveVideoStreamDebugParticipantId;
|
|
385
390
|
private _fixAudioDevice;
|
|
386
391
|
private _fixVideoDevice;
|
|
387
392
|
private _toggleJoinAvailability;
|
|
@@ -403,7 +408,6 @@ export default class Conversation extends EventEmitter {
|
|
|
403
408
|
private _onFeedback;
|
|
404
409
|
private _onDecorativeParticipantIdChanged;
|
|
405
410
|
private _onVideoSuspendSuggest;
|
|
406
|
-
private _onParticipantHold;
|
|
407
411
|
private _isMe;
|
|
408
412
|
private _getMuteStatesForRoomId;
|
|
409
413
|
private _getMuteStatesForCurrentRoom;
|
|
@@ -413,8 +417,6 @@ export default class Conversation extends EventEmitter {
|
|
|
413
417
|
private _getParticipants;
|
|
414
418
|
private _getParticipant;
|
|
415
419
|
}
|
|
416
|
-
declare function _resetPendingInstance(): void;
|
|
417
|
-
export { _resetPendingInstance };
|
|
418
420
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
419
421
|
readonly participantErrors: {
|
|
420
422
|
externalId: ExternalParticipantId;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import ConversationResponse from '../types/ConversationResponse';
|
|
2
|
+
export type ConversationResponseSource = 'startConversation' | 'joinConversation' | 'joinConversationByLink' | 'fastStart' | 'fastJoin';
|
|
3
|
+
export declare function assertValidConversationResponse(response: ConversationResponse | null | undefined, source: ConversationResponseSource): void;
|
package/classes/MediaSource.d.ts
CHANGED
|
@@ -47,7 +47,6 @@ export declare class MediaSource extends EventEmitter {
|
|
|
47
47
|
/** Трек аудио эффектов. Не изменяется на протяжении всего времени */
|
|
48
48
|
private _audioEffectsTrack;
|
|
49
49
|
private _mediaSettings;
|
|
50
|
-
private _lastMediaSettings;
|
|
51
50
|
private _videoStatusOnScreenCapturingEnabled;
|
|
52
51
|
private _effect;
|
|
53
52
|
private _audioEffectParams;
|
|
@@ -68,11 +67,7 @@ export declare class MediaSource extends EventEmitter {
|
|
|
68
67
|
getSendAudioTrack(): MediaStreamTrack | null;
|
|
69
68
|
get isAnimojiRequested(): boolean;
|
|
70
69
|
addTrackToPeerConnection(pc: RTCPeerConnection, observer: boolean, noDataChannel: boolean): void;
|
|
71
|
-
/**
|
|
72
|
-
* @deprecated Используйте гетер mediaSettings
|
|
73
|
-
*/
|
|
74
70
|
getMediaSettings(): MediaSettings;
|
|
75
|
-
get mediaSettings(): MediaSettings;
|
|
76
71
|
changeDevice(kind: MediaDeviceKind): Promise<void>;
|
|
77
72
|
/**
|
|
78
73
|
* Установка кастомного стрима для видео, например внешний шаринг экрана
|
|
@@ -100,8 +95,6 @@ export declare class MediaSource extends EventEmitter {
|
|
|
100
95
|
private _setEffect;
|
|
101
96
|
private _stopEffect;
|
|
102
97
|
destroy(): void;
|
|
103
|
-
stopLocalMedia(): Promise<void>;
|
|
104
|
-
resumeLocalMedia(): Promise<void>;
|
|
105
98
|
toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
|
|
106
99
|
disableScreenCapturing(): Promise<void>;
|
|
107
100
|
private videoTrackMuteHandler;
|
|
@@ -16,8 +16,6 @@ export default class SpecListener extends EventEmitter {
|
|
|
16
16
|
constructor(transport: Transport, volumesDetector: VolumesDetector, participants: Record<ParticipantId, Participant>, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
17
17
|
destroy(): void;
|
|
18
18
|
onChangeRemoteMediaSettings(participantId: ParticipantId, mediaSettings: MediaSettings): void;
|
|
19
|
-
private _getConnectionTimeout;
|
|
20
|
-
private _getVolumeTimeout;
|
|
21
19
|
private _onTransportStateChanged;
|
|
22
20
|
private _onVolumesDetected;
|
|
23
21
|
private _onConnectionTimeout;
|
|
@@ -4,6 +4,7 @@ import { StatAggregator } from './StatAggregator';
|
|
|
4
4
|
declare enum ECallType {
|
|
5
5
|
DirectOutgoing = "direct_outgoing",
|
|
6
6
|
DirectIncoming = "direct_incoming",
|
|
7
|
+
DirectJoin = "direct_join",
|
|
7
8
|
ServerIncoming = "server_incoming",
|
|
8
9
|
ServerJoinServer = "server_join_server",
|
|
9
10
|
ServerChangeTopology = "server_change_topology"
|
|
@@ -17,8 +18,8 @@ export declare class StatFirstMediaReceived {
|
|
|
17
18
|
constructor(statAggregator: StatAggregator);
|
|
18
19
|
markAcceptCall(topology: TransportTopology): void;
|
|
19
20
|
markAcceptedCall(topology?: TransportTopology): void;
|
|
20
|
-
markParticipantJoined(topology: TransportTopology): void;
|
|
21
21
|
markOnJoin(topology: TransportTopology): void;
|
|
22
|
+
markTopologyChanged(topology: TransportTopology): void;
|
|
22
23
|
private mark;
|
|
23
24
|
measure(): void;
|
|
24
25
|
}
|
|
@@ -11,6 +11,11 @@ import BaseTransport from './BaseTransport';
|
|
|
11
11
|
export default class DirectTransport extends BaseTransport {
|
|
12
12
|
private readonly _participantId;
|
|
13
13
|
private readonly _isMaster;
|
|
14
|
+
private _hasOutboundVideoDebug;
|
|
15
|
+
private _hasInboundVideoDebug;
|
|
16
|
+
private _outboundVideoDebugMediaType;
|
|
17
|
+
private _inboundVideoDebugMediaType;
|
|
18
|
+
private _videoDebugBytes;
|
|
14
19
|
private _remoteSDP;
|
|
15
20
|
private _remoteCandidates;
|
|
16
21
|
private _lastRemoteSDP;
|
|
@@ -75,6 +80,11 @@ export default class DirectTransport extends BaseTransport {
|
|
|
75
80
|
private static _patchRemoteDescription;
|
|
76
81
|
private _onReplacedTrack;
|
|
77
82
|
private _startStatInterval;
|
|
83
|
+
private _reportVideoStreamDebug;
|
|
84
|
+
private _isOutboundVideoDebugEnabled;
|
|
85
|
+
private _clearOutboundVideoDebug;
|
|
86
|
+
private _getVideoDebugMediaType;
|
|
87
|
+
private _getVideoDebugBitrate;
|
|
78
88
|
/**
|
|
79
89
|
* Check SVC support
|
|
80
90
|
* @see https://webrtc.internaut.com/mc/
|
|
@@ -9,6 +9,9 @@ import { CodecStatsAggregator } from '../stat/CodecStatsAggregator';
|
|
|
9
9
|
import { StatAggregator } from '../stat/StatAggregator';
|
|
10
10
|
import BaseTransport from './BaseTransport';
|
|
11
11
|
export default class ServerTransport extends BaseTransport {
|
|
12
|
+
private _outboundVideoDebugMediaTypes;
|
|
13
|
+
private _inboundVideoDebugParticipants;
|
|
14
|
+
private _videoDebugBytes;
|
|
12
15
|
private _producerNotification;
|
|
13
16
|
private _producerCommand;
|
|
14
17
|
private _producerScreen;
|
|
@@ -40,6 +43,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
40
43
|
private _participantIdRegistry;
|
|
41
44
|
private _disabledSenders;
|
|
42
45
|
private _rtpReceiversByStreamId;
|
|
46
|
+
private _participantIdByVideoTrackId;
|
|
43
47
|
private _producerSessionId;
|
|
44
48
|
private _newAudioShareTrack;
|
|
45
49
|
private _simulcastInfo;
|
|
@@ -82,6 +86,16 @@ export default class ServerTransport extends BaseTransport {
|
|
|
82
86
|
private _stopSettingsInterval;
|
|
83
87
|
private _collectStat;
|
|
84
88
|
private _reportStats;
|
|
89
|
+
private _reportVideoStreamDebug;
|
|
90
|
+
private _isOutboundVideoDebugEnabled;
|
|
91
|
+
private _getOutboundVideoDebugMediaType;
|
|
92
|
+
private _getOutboundVideoDebugTrack;
|
|
93
|
+
private _getVideoDebugStreamId;
|
|
94
|
+
private _getVideoDebugTrackId;
|
|
95
|
+
private _createVideoDebugLayer;
|
|
96
|
+
private _getScreenShareDebugMethod;
|
|
97
|
+
private _sumVideoDebugBitrate;
|
|
98
|
+
private _getVideoDebugBitrate;
|
|
85
99
|
private _detectStaleTracks;
|
|
86
100
|
private _allocateConsumer;
|
|
87
101
|
private _processOffer;
|
|
@@ -3,7 +3,9 @@ import BaseSignaling from '../../abstract/BaseSignaling';
|
|
|
3
3
|
import TransportState from '../../enums/TransportState';
|
|
4
4
|
import TransportTopology from '../../enums/TransportTopology';
|
|
5
5
|
import { type DebugLogger } from '../../static/Debug';
|
|
6
|
+
import { VideoStreamDebugDirection, type VideoStreamDebugLayer } from '../../static/DebugVideoStats';
|
|
6
7
|
import { ParticipantId } from '../../types/Participant';
|
|
8
|
+
import type { MediaType } from '../../types/ParticipantStreamDescription';
|
|
7
9
|
import ServerSettings from '../../types/ServerSettings';
|
|
8
10
|
import EventEmitter from '../EventEmitter';
|
|
9
11
|
import StatsLogger from '../StatsLogger';
|
|
@@ -27,8 +29,24 @@ export declare const enum TransportEvent {
|
|
|
27
29
|
ASR_TRANSCRIPTION = "ASR_TRANSCRIPTION",
|
|
28
30
|
ANIMOJI_STREAM = "ANIMOJI_STREAM",
|
|
29
31
|
ANIMOJI_ERROR = "ANIMOJI_ERROR",
|
|
30
|
-
SCREEN_SHARING_STAT = "SCREEN_SHARING_STAT"
|
|
32
|
+
SCREEN_SHARING_STAT = "SCREEN_SHARING_STAT",
|
|
33
|
+
VIDEO_STREAM_DEBUG = "VIDEO_STREAM_DEBUG"
|
|
31
34
|
}
|
|
35
|
+
export type VideoStreamDebugEvent = {
|
|
36
|
+
direction: VideoStreamDebugDirection;
|
|
37
|
+
mediaType?: MediaType.CAMERA | MediaType.SCREEN;
|
|
38
|
+
streamId?: ParticipantId;
|
|
39
|
+
trackId?: string;
|
|
40
|
+
mimeType?: string;
|
|
41
|
+
width?: number;
|
|
42
|
+
height?: number;
|
|
43
|
+
frameRate?: number;
|
|
44
|
+
bitrate?: number;
|
|
45
|
+
packetsLost?: number;
|
|
46
|
+
screenShareMethod?: string;
|
|
47
|
+
layers?: VideoStreamDebugLayer[];
|
|
48
|
+
clear?: boolean;
|
|
49
|
+
};
|
|
32
50
|
export declare class Transport extends EventEmitter {
|
|
33
51
|
private readonly _signaling;
|
|
34
52
|
private readonly _mediaSource;
|
|
@@ -82,6 +100,7 @@ export declare class Transport extends EventEmitter {
|
|
|
82
100
|
private _onPeerConnectionClosed;
|
|
83
101
|
private _onServerAudioMixStall;
|
|
84
102
|
private _onRemoteDataStats;
|
|
103
|
+
private _onVideoStreamDebug;
|
|
85
104
|
private _onRemoteTrackAdded;
|
|
86
105
|
private _onRemoteTrackRemoved;
|
|
87
106
|
private _onAsrTranscription;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ import TransportTopology from '../enums/TransportTopology';
|
|
|
9
9
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
10
10
|
import ConversationOption from '../enums/ConversationOption';
|
|
11
11
|
import MediaOption from '../enums/MediaOption';
|
|
12
|
-
import SignalingCommandType from '../enums/SignalingCommandType';
|
|
13
12
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
14
13
|
import UserRole from '../enums/UserRole';
|
|
15
14
|
import { type DebugLogger } from '../static/Debug';
|
|
@@ -26,29 +25,24 @@ import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/Partici
|
|
|
26
25
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
27
26
|
import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
|
|
28
27
|
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
29
|
-
import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse
|
|
28
|
+
import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse } from '../types/SignalingMessage';
|
|
30
29
|
import { IPublishStreamData, IStartStreamData, IStopStreamData } from '../types/Streams';
|
|
31
30
|
export default class Signaling extends BaseSignaling {
|
|
32
|
-
private
|
|
33
|
-
|
|
31
|
+
private transport;
|
|
32
|
+
private sequence;
|
|
34
33
|
private lastStamp;
|
|
35
34
|
private websocketCommandsQueue;
|
|
36
35
|
private datachannelCommandsQueue;
|
|
37
36
|
private incomingCache;
|
|
38
37
|
private responseHandlers;
|
|
39
38
|
private connectionType;
|
|
40
|
-
private
|
|
41
|
-
private
|
|
42
|
-
private wtEndpoint;
|
|
43
|
-
protected conversationResolve: Function | null;
|
|
44
|
-
protected conversationReject: Function | null;
|
|
39
|
+
private conversationResolve;
|
|
40
|
+
private conversationReject;
|
|
45
41
|
private connected;
|
|
46
42
|
private listenersReady;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
private reconnectTimer;
|
|
43
|
+
private peerId;
|
|
44
|
+
private conversationId;
|
|
50
45
|
private connectionMessageWaitTimer;
|
|
51
|
-
private doctorTimer;
|
|
52
46
|
private participantIdRegistry;
|
|
53
47
|
private producerNotificationDataChannel;
|
|
54
48
|
private producerCommandDataChannel;
|
|
@@ -57,16 +51,13 @@ export default class Signaling extends BaseSignaling {
|
|
|
57
51
|
private readonly _debug;
|
|
58
52
|
private readonly _logger;
|
|
59
53
|
private readonly _statAggregator;
|
|
60
|
-
private readonly
|
|
61
|
-
private readonly
|
|
62
|
-
private static get RECONNECT_DELAY();
|
|
63
|
-
private static get RECONNECT_MAX_DELAY();
|
|
64
|
-
private static get RECONNECT_MAX_COUNT();
|
|
54
|
+
private readonly _statPings;
|
|
55
|
+
private readonly _statSignalingCommands;
|
|
65
56
|
private static get WAIT_CONNECTION_DELAY();
|
|
66
57
|
private static get WAIT_RESPONSE_DELAY();
|
|
67
|
-
private static get WAIT_MESSAGE_DELAY();
|
|
68
|
-
constructor(debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, pings?: StatPings | null, signalingCommands?: StatSignalingCommands | null);
|
|
69
58
|
get ready(): boolean;
|
|
59
|
+
constructor(debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, statPings?: StatPings | null, statSignalingCommands?: StatSignalingCommands | null);
|
|
60
|
+
setAbortSignal(signal: AbortSignal | undefined): void;
|
|
70
61
|
setEndpoint(endpoint: string): void;
|
|
71
62
|
setWebTransportEndpoint(endpoint: string | null): void;
|
|
72
63
|
setConversationId(conversationId: string): void;
|
|
@@ -82,15 +73,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
82
73
|
* Open a connection with a signaling server
|
|
83
74
|
*/
|
|
84
75
|
connect(connectionType: SignalingConnectionType): Promise<SignalingMessage.Connection>;
|
|
85
|
-
/**
|
|
86
|
-
* Send a command to a signaling server
|
|
87
|
-
*/
|
|
88
|
-
protected _send<T extends SignalingSuccessResponse>(command: SignalingCommandType, params?: any, needResponse?: boolean, retryCount?: number): Promise<T>;
|
|
89
|
-
/**
|
|
90
|
-
* Send a raw command to a signaling server
|
|
91
|
-
*/
|
|
92
|
-
protected _sendRaw<T extends SignalingSuccessResponse>(command: SignalingCommandType, params?: any, needResponse?: boolean, retryCount?: number): Promise<T>;
|
|
93
|
-
private _isDataChannelCommand;
|
|
94
76
|
getNextCommandSequenceNumber(): number;
|
|
95
77
|
hangup(reason: string): Promise<SignalingMessage | void>;
|
|
96
78
|
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
|
|
@@ -173,34 +155,36 @@ export default class Signaling extends BaseSignaling {
|
|
|
173
155
|
startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
|
|
174
156
|
stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
|
|
175
157
|
requestAsr(request: boolean): Promise<SignalingMessage>;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Send a command to a signaling server
|
|
160
|
+
*/
|
|
161
|
+
private _send;
|
|
162
|
+
/**
|
|
163
|
+
* Send a raw command to a signaling server
|
|
164
|
+
*/
|
|
165
|
+
private _sendRaw;
|
|
166
|
+
private _isDataChannelCommand;
|
|
179
167
|
private _onOpen;
|
|
180
168
|
private _onMessage;
|
|
181
|
-
|
|
169
|
+
private _handleMessage;
|
|
182
170
|
private _handleErrorMessage;
|
|
183
|
-
|
|
171
|
+
private _handleCachedMessages;
|
|
184
172
|
private _throwError;
|
|
185
173
|
private _onError;
|
|
186
174
|
private _serializeErrorEvent;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
protected _reconnect(): void;
|
|
175
|
+
private _onClose;
|
|
176
|
+
private _closeSocket;
|
|
190
177
|
private _handleCommandResponse;
|
|
191
178
|
private _handleCommandsQueue;
|
|
192
179
|
private _startResponseTimer;
|
|
193
180
|
private _serializeBinary;
|
|
194
181
|
private _serializeJson;
|
|
195
182
|
private _convertDisplayLayout;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
private _startDoctor;
|
|
202
|
-
private _stopDoctor;
|
|
203
|
-
private isWebTransportAvailable;
|
|
183
|
+
private _waitConnectionMessage;
|
|
184
|
+
private _stopWaitConnectionMessage;
|
|
185
|
+
private _onTransportFailed;
|
|
186
|
+
private _onTransportReconnectScheduled;
|
|
187
|
+
private _onTransportConnectionDead;
|
|
204
188
|
private _getSocketType;
|
|
205
189
|
private _markTransportStat;
|
|
206
190
|
private _logTransportStat;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
2
|
+
import { SignalingTransportType } from '../enums/SignalingTransportStat';
|
|
3
|
+
export declare enum SignalingTransportFailure {
|
|
4
|
+
EMPTY_ENDPOINT = "EMPTY_ENDPOINT",
|
|
5
|
+
NETWORK_ERROR = "NETWORK_ERROR",
|
|
6
|
+
ABORTED = "ABORTED"
|
|
7
|
+
}
|
|
8
|
+
export type SignalingTransportFailedEvent = {
|
|
9
|
+
failure: SignalingTransportFailure;
|
|
10
|
+
message: string;
|
|
11
|
+
remote?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type SignalingTransportReconnectEvent = {
|
|
14
|
+
count: number;
|
|
15
|
+
delay: number;
|
|
16
|
+
};
|
|
17
|
+
export type SignalingTransportHandlers = {
|
|
18
|
+
onOpen: () => void;
|
|
19
|
+
onMessage: (event: MessageEvent) => void;
|
|
20
|
+
onError: (event: Event) => void;
|
|
21
|
+
onClose: (event: CloseEvent) => void;
|
|
22
|
+
onFailed: (event: SignalingTransportFailedEvent) => void;
|
|
23
|
+
onReconnectScheduled: (event: SignalingTransportReconnectEvent) => void;
|
|
24
|
+
onConnectionDead: () => void;
|
|
25
|
+
};
|
|
26
|
+
export default class SignalingTransport {
|
|
27
|
+
private readonly handlers;
|
|
28
|
+
private socket;
|
|
29
|
+
private endpoint;
|
|
30
|
+
private wtEndpoint;
|
|
31
|
+
private peerId;
|
|
32
|
+
private lastStamp;
|
|
33
|
+
private connectionType;
|
|
34
|
+
private reconnectCount;
|
|
35
|
+
private reconnectTimer;
|
|
36
|
+
private doctorTimer;
|
|
37
|
+
private forceWebSocket;
|
|
38
|
+
private abortSignal;
|
|
39
|
+
private manualClose;
|
|
40
|
+
private currentType;
|
|
41
|
+
constructor(handlers: SignalingTransportHandlers);
|
|
42
|
+
get readyState(): number | null;
|
|
43
|
+
get type(): SignalingTransportType;
|
|
44
|
+
setEndpoint(endpoint: string): void;
|
|
45
|
+
setWebTransportEndpoint(endpoint: string | null): void;
|
|
46
|
+
setPeerId(peerId: number | null): void;
|
|
47
|
+
setLastStamp(lastStamp: number): void;
|
|
48
|
+
setAbortSignal(signal?: AbortSignal): void;
|
|
49
|
+
resetReconnectCount(): void;
|
|
50
|
+
connect(connectionType: SignalingConnectionType): void;
|
|
51
|
+
close(code?: number): void;
|
|
52
|
+
send(data: string | ArrayBuffer): void;
|
|
53
|
+
private _connect;
|
|
54
|
+
private _connectWebTransport;
|
|
55
|
+
private _connectWebSocket;
|
|
56
|
+
private _setSocketHandlers;
|
|
57
|
+
private _buildUrl;
|
|
58
|
+
private _canUseWebTransport;
|
|
59
|
+
private _onOpen;
|
|
60
|
+
private _onMessage;
|
|
61
|
+
private _onError;
|
|
62
|
+
private _onClose;
|
|
63
|
+
private _disconnect;
|
|
64
|
+
private _scheduleReconnect;
|
|
65
|
+
private _getReconnectDelay;
|
|
66
|
+
private _startDoctor;
|
|
67
|
+
private _stopDoctor;
|
|
68
|
+
}
|
package/enums/HangupType.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ declare enum HangupType {
|
|
|
53
53
|
* - Приложение вызываемого не запущено или упало
|
|
54
54
|
* - Брандмауэр или сетевые ограничения блокируют подключение
|
|
55
55
|
*/
|
|
56
|
-
CALL_TIMEOUT = "CALL_TIMEOUT"
|
|
56
|
+
CALL_TIMEOUT = "CALL_TIMEOUT",
|
|
57
|
+
OBSOLETE_CLIENT = "OBSOLETE_CLIENT"
|
|
57
58
|
}
|
|
58
59
|
export default HangupType;
|
|
@@ -50,7 +50,6 @@ declare enum SignalingNotification {
|
|
|
50
50
|
ASR_STARTED = "asr-started",
|
|
51
51
|
ASR_STOPPED = "asr-stopped",
|
|
52
52
|
DECORATIVE_PARTICIPANT_ID_CHANGED = "decorative-participant-id-changed",
|
|
53
|
-
VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest"
|
|
54
|
-
HOLD = "hold"
|
|
53
|
+
VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest"
|
|
55
54
|
}
|
|
56
55
|
export default SignalingNotification;
|
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ExternalParticipantId } from '../types/ExternalId';
|
|
2
|
+
import type { MediaType } from '../types/ParticipantStreamDescription';
|
|
3
|
+
export declare const enum VideoStreamDebugDirection {
|
|
4
|
+
INBOUND = "inbound",
|
|
5
|
+
OUTBOUND = "outbound"
|
|
6
|
+
}
|
|
7
|
+
export type VideoStreamDebugData = {
|
|
8
|
+
mediaType: MediaType.CAMERA | MediaType.SCREEN;
|
|
9
|
+
direction: VideoStreamDebugDirection;
|
|
10
|
+
externalParticipantId: ExternalParticipantId;
|
|
11
|
+
trackId?: string;
|
|
12
|
+
mimeType?: string;
|
|
13
|
+
width?: number;
|
|
14
|
+
height?: number;
|
|
15
|
+
frameRate?: number;
|
|
16
|
+
bitrate?: number;
|
|
17
|
+
packetsLost?: number;
|
|
18
|
+
screenShareMethod?: string;
|
|
19
|
+
layers?: VideoStreamDebugLayer[];
|
|
20
|
+
};
|
|
21
|
+
export type VideoStreamDebugLayer = {
|
|
22
|
+
rid?: string;
|
|
23
|
+
ssrc?: number;
|
|
24
|
+
trackId?: string;
|
|
25
|
+
mimeType?: string;
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
frameRate?: number;
|
|
29
|
+
bitrate?: number;
|
|
30
|
+
packetsLost?: number;
|
|
31
|
+
};
|
|
32
|
+
declare namespace DebugVideoStats {
|
|
33
|
+
function format(data: VideoStreamDebugData): string;
|
|
34
|
+
function send(data: VideoStreamDebugData): void;
|
|
35
|
+
function clear(externalParticipantId: ExternalParticipantId, mediaType: MediaType.CAMERA | MediaType.SCREEN): void;
|
|
36
|
+
}
|
|
37
|
+
export default DebugVideoStats;
|