@vkontakte/calls-sdk 2.8.12-dev.aa3efa18.0 → 2.8.12-dev.bbebddf4.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 +24 -4
- package/abstract/BaseApi.d.ts +2 -1
- package/abstract/BaseSignaling.d.ts +5 -1
- package/calls-sdk.cjs.js +7 -13
- package/calls-sdk.esm.js +2594 -2385
- package/classes/MediaSource.d.ts +2 -0
- package/classes/conversation/Conversation.d.ts +9 -2
- package/classes/stat/StatAggregator.d.ts +4 -0
- package/classes/transport/PerfStatReporter.d.ts +2 -0
- package/classes/transport/ServerTransport.d.ts +1 -4
- package/classes/transport/SimulcastSender.d.ts +31 -0
- package/classes/transport/Transport.d.ts +3 -0
- package/default/Api.d.ts +4 -1
- package/default/ApiExternal.d.ts +2 -1
- package/default/Signaling.d.ts +2 -1
- package/enums/ClientHangupReason.d.ts +7 -0
- package/package.json +3 -3
- package/static/ApiTransport.d.ts +3 -0
- package/static/Params.d.ts +27 -1
- package/static/ParticipantConnectionStatusUtils.d.ts +1 -0
- package/static/Sdp.d.ts +3 -0
- package/static/SignalingCapabilities.d.ts +1 -1
- package/static/SimulcastInfo.d.ts +5 -3
- package/static/Utils.d.ts +1 -2
- package/static/WebRTCUtils.d.ts +4 -7
- package/types/Api.d.ts +9 -0
- package/types/Capabilities.d.ts +1 -0
- package/types/Participant.d.ts +1 -0
- package/types/PerfStatReporter.d.ts +0 -4
- package/types/SignalingCommand.d.ts +2 -0
- package/types/SignalingMessage.d.ts +1 -0
- package/utils/NavigatorPermissions.d.ts +2 -2
- package/utils/SerializeLatest.d.ts +5 -0
package/classes/MediaSource.d.ts
CHANGED
|
@@ -99,6 +99,8 @@ export declare class MediaSource extends EventEmitter {
|
|
|
99
99
|
protected getSilentAudioShareTrack(): MediaStreamTrack;
|
|
100
100
|
protected getBlackScreenShareTrack(): MediaStreamTrack;
|
|
101
101
|
protected _replaceLocalTrack(newTrack: MediaStreamTrack, sendTrack?: MediaStreamTrack): Promise<void>;
|
|
102
|
+
protected _replaceTrack(oldTrack: MediaStreamTrack, newTrack: MediaStreamTrack, sendTrack?: MediaStreamTrack): Promise<void>;
|
|
103
|
+
protected _addLocalTrack(newTrack: MediaStreamTrack, sendTrack?: MediaStreamTrack): Promise<void>;
|
|
102
104
|
private _setEffect;
|
|
103
105
|
private _stopEffect;
|
|
104
106
|
destroy(): void;
|
|
@@ -5,6 +5,7 @@ import BaseLogger from '../../abstract/BaseLogger';
|
|
|
5
5
|
import { AddParticipantParams } from '../../abstract/BaseSignaling';
|
|
6
6
|
import ConversationFeature from '../../enums/ConversationFeature';
|
|
7
7
|
import ConversationOption from '../../enums/ConversationOption';
|
|
8
|
+
import type ClientHangupReason from '../../enums/ClientHangupReason';
|
|
8
9
|
import MediaOption from '../../enums/MediaOption';
|
|
9
10
|
import UpdateDisplayLayoutErrorReason from '../../enums/UpdateDisplayLayoutErrorReason';
|
|
10
11
|
import UserRole from '../../enums/UserRole';
|
|
@@ -104,8 +105,8 @@ export default class Conversation extends EventEmitter {
|
|
|
104
105
|
private _getMainRoomParticipants;
|
|
105
106
|
private _decodeExternalConversationParams;
|
|
106
107
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
107
|
-
decline(): Promise<void>;
|
|
108
|
-
hangup(): Promise<void>;
|
|
108
|
+
decline(reason?: ClientHangupReason): Promise<void>;
|
|
109
|
+
hangup(reason?: ClientHangupReason): Promise<void>;
|
|
109
110
|
addParticipant(participantIds: ExternalId[], params?: AddParticipantParams): Promise<void>;
|
|
110
111
|
addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<void>;
|
|
111
112
|
removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<void>;
|
|
@@ -113,8 +114,10 @@ export default class Conversation extends EventEmitter {
|
|
|
113
114
|
updateStatisticsInterval(): void;
|
|
114
115
|
private _openTransport;
|
|
115
116
|
private _allocateParticipantTransport;
|
|
117
|
+
private _closeParticipantTransport;
|
|
116
118
|
private _cleanupRegistry;
|
|
117
119
|
private _emitHangupOnce;
|
|
120
|
+
private _sendHangupApi;
|
|
118
121
|
private _close;
|
|
119
122
|
destroy(): void;
|
|
120
123
|
private _destroy;
|
|
@@ -220,6 +223,8 @@ export default class Conversation extends EventEmitter {
|
|
|
220
223
|
setAnimojiFill(fill: RGBTuple | string): void;
|
|
221
224
|
setVideoStream(stream: MediaStream, isScreen?: boolean): Promise<void>;
|
|
222
225
|
setAudioStream(stream: MediaStream): Promise<void>;
|
|
226
|
+
private readonly _toggleLocalVideo;
|
|
227
|
+
private readonly _toggleLocalAudio;
|
|
223
228
|
toggleLocalVideo(enabled: boolean): Promise<void>;
|
|
224
229
|
toggleLocalAudio(enabled: boolean): Promise<void>;
|
|
225
230
|
/**
|
|
@@ -416,6 +421,8 @@ export default class Conversation extends EventEmitter {
|
|
|
416
421
|
private _toggleJoinAvailability;
|
|
417
422
|
private _updateDisplayLayoutFromCache;
|
|
418
423
|
private _setParticipantsStatus;
|
|
424
|
+
private _setParticipantsStalled;
|
|
425
|
+
private _updateParticipantsStatus;
|
|
419
426
|
private _onJoinLinkChanged;
|
|
420
427
|
private _onRoomsUpdated;
|
|
421
428
|
private _onRoomUpdated;
|
|
@@ -4,9 +4,13 @@ import StatsLogger from '../StatsLogger';
|
|
|
4
4
|
export declare class StatAggregator {
|
|
5
5
|
private readonly _logger;
|
|
6
6
|
private readonly _eventualLogs;
|
|
7
|
+
private _lastCallStatContext;
|
|
7
8
|
constructor(logger: StatsLogger);
|
|
8
9
|
logCallStat(params: ICallStatLog): void;
|
|
9
10
|
/** @link https://wiki.odkl.ru/pages/viewpage.action?pageId=100892588 */
|
|
10
11
|
logEventualStat(params: IEventualStatLog): void;
|
|
11
12
|
destroy(): void;
|
|
13
|
+
private _getCallStatContext;
|
|
14
|
+
private _flushEventualStats;
|
|
15
|
+
private _logEventualStat;
|
|
12
16
|
}
|
|
@@ -9,6 +9,7 @@ export default class PerfStatReporter extends EventEmitter {
|
|
|
9
9
|
private _previousNetworkStatReportTimestamp;
|
|
10
10
|
private _previousCallStatReportTimestamp;
|
|
11
11
|
private _previousCallStatReport;
|
|
12
|
+
private _previousRemoteInboundRtps;
|
|
12
13
|
private _screenShareStats;
|
|
13
14
|
private _signaling;
|
|
14
15
|
private readonly _directTopology;
|
|
@@ -21,6 +22,7 @@ export default class PerfStatReporter extends EventEmitter {
|
|
|
21
22
|
private reportPerfStats;
|
|
22
23
|
private reportNetworkStats;
|
|
23
24
|
private _reportCallStats;
|
|
25
|
+
private _calculatePacketLoss;
|
|
24
26
|
private _handleScreenSharingStat;
|
|
25
27
|
private _handleTransportStateChanged;
|
|
26
28
|
}
|
|
@@ -42,11 +42,11 @@ export default class ServerTransport extends BaseTransport {
|
|
|
42
42
|
private _rtpReceiversByStreamId;
|
|
43
43
|
private _producerSessionId;
|
|
44
44
|
private _newAudioShareTrack;
|
|
45
|
-
private _simulcastInfo;
|
|
46
45
|
private readonly _debug;
|
|
47
46
|
private readonly _logger;
|
|
48
47
|
private readonly _statAggregator;
|
|
49
48
|
private readonly _codecStatsAggregator;
|
|
49
|
+
private readonly _simulcast;
|
|
50
50
|
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
|
51
51
|
updateStatisticsInterval(): void;
|
|
52
52
|
open(observer?: boolean): void;
|
|
@@ -85,8 +85,6 @@ export default class ServerTransport extends BaseTransport {
|
|
|
85
85
|
private _detectStaleTracks;
|
|
86
86
|
private _allocateConsumer;
|
|
87
87
|
private _processOffer;
|
|
88
|
-
private _findFirstSimTransceiver;
|
|
89
|
-
private _setupSimulcastTransceiver;
|
|
90
88
|
private _acceptProducer;
|
|
91
89
|
private _replaceScreenShareTrack;
|
|
92
90
|
private _handleTracks;
|
|
@@ -101,7 +99,6 @@ export default class ServerTransport extends BaseTransport {
|
|
|
101
99
|
private _onReplacedTrack;
|
|
102
100
|
private _onSourcesChanged;
|
|
103
101
|
getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
|
|
104
|
-
private _changeSimulcastInfo;
|
|
105
102
|
private _monitorRtpShare;
|
|
106
103
|
private _startMonitorRtpShareInterval;
|
|
107
104
|
private _stopMonitorRtpShareInterval;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
3
|
+
import type VideoSettings from '../../types/VideoSettings';
|
|
4
|
+
import { MediaSource } from '../MediaSource';
|
|
5
|
+
import StatsLogger from '../StatsLogger';
|
|
6
|
+
export default class SimulcastSender {
|
|
7
|
+
private _pc;
|
|
8
|
+
private _transceiver;
|
|
9
|
+
private _currentSimulcastInfo;
|
|
10
|
+
private readonly _signaling;
|
|
11
|
+
private readonly _mediaSource;
|
|
12
|
+
private readonly _getCameraSettings;
|
|
13
|
+
private readonly _debug;
|
|
14
|
+
private readonly _logger;
|
|
15
|
+
constructor(signaling: BaseSignaling, mediaSource: MediaSource, getCameraSettings: () => VideoSettings | null, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
16
|
+
configureFromRemoteOffer(pc: RTCPeerConnection): Promise<void>;
|
|
17
|
+
finalizeAnswer(sdp: string): string;
|
|
18
|
+
sync({ force }?: {
|
|
19
|
+
force?: boolean;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
replaceTrack(track: MediaStreamTrack): boolean;
|
|
22
|
+
reset(): void;
|
|
23
|
+
private _findTransceiver;
|
|
24
|
+
private _findMediaSection;
|
|
25
|
+
private _getConfig;
|
|
26
|
+
private _getTrackConfig;
|
|
27
|
+
private _applyConfig;
|
|
28
|
+
private _applyCurrentMediaState;
|
|
29
|
+
private _syncReplacedTrack;
|
|
30
|
+
private _changeSimulcast;
|
|
31
|
+
}
|
|
@@ -50,6 +50,7 @@ export declare class Transport extends EventEmitter {
|
|
|
50
50
|
private readonly _codecStatsAggregator;
|
|
51
51
|
private readonly _onFirstMediaSent;
|
|
52
52
|
private _firstMediaSentProbeStopped;
|
|
53
|
+
private _vadController;
|
|
53
54
|
constructor(topology: TransportTopology, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
|
54
55
|
updateSettings(settings: ServerSettings): void;
|
|
55
56
|
updateStatisticsInterval(): void;
|
|
@@ -96,6 +97,8 @@ export declare class Transport extends EventEmitter {
|
|
|
96
97
|
private _onAnimojiStream;
|
|
97
98
|
/** Обработчик, досылающий MediaSourceEvent.SOURCE_CHANGED событие до аллокации транспортов */
|
|
98
99
|
private _onAnimojiStatus;
|
|
100
|
+
private _createVad;
|
|
101
|
+
private _updateVadTrack;
|
|
99
102
|
private _createAnimojiTransport;
|
|
100
103
|
private _removeAnimojiTransport;
|
|
101
104
|
getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
|
package/default/Api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import BaseApi, { ClientStats } from '../abstract/BaseApi';
|
|
2
2
|
import CallType from '../enums/CallType';
|
|
3
3
|
import HangupType from '../enums/HangupType';
|
|
4
|
+
import { IHangupParams } from '../types/Api';
|
|
4
5
|
import ConversationParams from '../types/ConversationParams';
|
|
5
6
|
import ConversationResponse from '../types/ConversationResponse';
|
|
6
7
|
import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
|
|
@@ -17,7 +18,9 @@ export default class Api extends BaseApi {
|
|
|
17
18
|
private _getCachedAnonymLogin;
|
|
18
19
|
private _setCachedAnonymLogin;
|
|
19
20
|
private _removeCachedAnonymLogin;
|
|
21
|
+
private _reauthorize;
|
|
20
22
|
private _applyAnonymLogin;
|
|
23
|
+
private _sendClientStats;
|
|
21
24
|
logClientStats(items: ClientStats[]): void;
|
|
22
25
|
uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
|
|
23
26
|
joinConversation(conversationId: string, isVideo?: boolean, chatId?: string): Promise<ConversationResponse>;
|
|
@@ -55,7 +58,7 @@ export default class Api extends BaseApi {
|
|
|
55
58
|
getConversationParams(conversationId?: string): Promise<ConversationParams>;
|
|
56
59
|
getUserId(): OkUserId | null;
|
|
57
60
|
setUserId(userId: OkUserId): void;
|
|
58
|
-
hangupConversation(conversationId: string, reason?: HangupType): void;
|
|
61
|
+
hangupConversation(conversationId: string, reason?: HangupType, params?: Partial<IHangupParams>): void;
|
|
59
62
|
removeHistoryRecords(recordIds: number[]): Promise<void>;
|
|
60
63
|
cleanup(): void;
|
|
61
64
|
getServerTime(): Promise<number>;
|
package/default/ApiExternal.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IHangupParams } from '../types/Api';
|
|
1
2
|
import { IAPIBaseUrl, IApiEnv } from '../types/Params';
|
|
2
3
|
export declare class ApiExternal {
|
|
3
4
|
private readonly _uuid;
|
|
@@ -8,5 +9,5 @@ export declare class ApiExternal {
|
|
|
8
9
|
private _sessionKey;
|
|
9
10
|
constructor(apiEvn: IApiEnv, apiKey: string, callToken: string, baseApiUrl?: IAPIBaseUrl);
|
|
10
11
|
authorize(): Promise<boolean>;
|
|
11
|
-
hangupConversation(conversationId: string): Promise<void>;
|
|
12
|
+
hangupConversation(conversationId: string, params?: Partial<IHangupParams>): Promise<void>;
|
|
12
13
|
}
|
package/default/Signaling.d.ts
CHANGED
|
@@ -64,13 +64,14 @@ export default class Signaling extends BaseSignaling {
|
|
|
64
64
|
setProducerNotificationDataChannel(dataChannel: RTCDataChannel): void;
|
|
65
65
|
setProducerCommandDataChannel(dataChannel: RTCDataChannel): void;
|
|
66
66
|
useCommandDataChannel(status: boolean): void;
|
|
67
|
+
resetProducerConnection(cause?: Error): void;
|
|
67
68
|
/**
|
|
68
69
|
* Open a connection with a signaling server
|
|
69
70
|
*/
|
|
70
71
|
connect(connectionType: SignalingConnectionType): Promise<SignalingMessage.Connection>;
|
|
71
72
|
getNextCommandSequenceNumber(): number;
|
|
72
73
|
hangup(reason: string): Promise<SignalingMessage>;
|
|
73
|
-
sendCandidate(participantId: ParticipantId, candidate:
|
|
74
|
+
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidateInit): Promise<SignalingMessage>;
|
|
74
75
|
requestTestMode(consumerCommand: string, producerCommand: string | null): Promise<SignalingMessage>;
|
|
75
76
|
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit, extraPayload?: Record<string, any>): Promise<SignalingMessage>;
|
|
76
77
|
acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import HangupType from './HangupType';
|
|
2
|
+
/**
|
|
3
|
+
* Причины завершения звонка, которые клиент может передать в {@link hangup}/{@link declineCall}
|
|
4
|
+
* и пробросить в сигналинг без маппинга.
|
|
5
|
+
*/
|
|
6
|
+
export type ClientHangupReason = HangupType.HUNGUP | HangupType.CANCELED | HangupType.REJECTED | HangupType.BUSY | HangupType.MISSED | HangupType.CALL_TIMEOUT;
|
|
7
|
+
export default ClientHangupReason;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/calls-sdk",
|
|
3
|
-
"version": "2.8.12-dev.
|
|
3
|
+
"version": "2.8.12-dev.bbebddf4.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Library for video calls based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"**/*.d.ts"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@vkontakte/calls-audio-effects": "1.
|
|
17
|
+
"@vkontakte/calls-audio-effects": "1.4.1",
|
|
18
18
|
"@vkontakte/calls-video-effects": "2.2.3-beta.7",
|
|
19
19
|
"@vkontakte/calls-vmoji": "1.0.10-beta.17",
|
|
20
20
|
"@vkontakte/libvpx": "2.0.9",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"fflate": "^0.8.2",
|
|
23
23
|
"messagepack": "1.1.12",
|
|
24
24
|
"simple-ebml-builder": "0.2.2",
|
|
25
|
-
"webrtc-adapter": "
|
|
25
|
+
"webrtc-adapter": "9.0.5"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/static/ApiTransport.d.ts
CHANGED
|
@@ -7,4 +7,7 @@ export declare function sendBeakon(method: string, params?: {
|
|
|
7
7
|
export declare function request(method: string, params?: {
|
|
8
8
|
[key: string]: any;
|
|
9
9
|
}, noSession?: boolean, customEndpoint?: string): Promise<any>;
|
|
10
|
+
export declare function requestKeepalive(method: string, params?: {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}, noSession?: boolean): Promise<any>;
|
|
10
13
|
export declare function sendFormData(url: string, data: FormData): Promise<void>;
|
package/static/Params.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VideoEffects } from '@vkontakte/calls-video-effects';
|
|
2
|
-
import type { EffectVoiceChange } from '@vkontakte/calls-audio-effects';
|
|
2
|
+
import type { EffectVoiceChange, VadControllerOptions, VadLib } from '@vkontakte/calls-audio-effects';
|
|
3
3
|
import type * as Vmoji from '@vkontakte/calls-vmoji';
|
|
4
4
|
import { IAsrData } from '../types/Asr';
|
|
5
5
|
import { ConversationData } from '../types/Conversation';
|
|
@@ -193,6 +193,14 @@ export type ParamsObject = {
|
|
|
193
193
|
* Можно установить позднее методом `setAudioEffects`
|
|
194
194
|
*/
|
|
195
195
|
audioEffects: EffectVoiceChange | null;
|
|
196
|
+
/**
|
|
197
|
+
* Namespace библиотеки VAD из `@vkontakte/calls-audio-effects`.
|
|
198
|
+
*
|
|
199
|
+
* Можно установить методом `setVad`
|
|
200
|
+
*/
|
|
201
|
+
vad: VadLib | null;
|
|
202
|
+
/** Настройки VAD (threshold, hangoverMs, enabled) */
|
|
203
|
+
vadOptions: VadControllerOptions;
|
|
196
204
|
/**
|
|
197
205
|
* Максимальная ширина видео в пикселях для видео эффекта
|
|
198
206
|
*
|
|
@@ -505,6 +513,16 @@ export type ParamsObject = {
|
|
|
505
513
|
* _По умолчанию: `false`_
|
|
506
514
|
*/
|
|
507
515
|
enableSessionStateUpdates: boolean;
|
|
516
|
+
/**
|
|
517
|
+
* Использовать `<audio>` вместо `<video>` для воспроизведения звука в desktop Safari
|
|
518
|
+
* @hidden
|
|
519
|
+
*/
|
|
520
|
+
safariAudioElement: boolean;
|
|
521
|
+
/**
|
|
522
|
+
* Отправлять пустой ICE candidate (end-of-candidates) удалённому пиру
|
|
523
|
+
* @hidden
|
|
524
|
+
*/
|
|
525
|
+
forwardEmptyIceCandidate: boolean;
|
|
508
526
|
/**
|
|
509
527
|
* Получен локальный стрим с камеры/микрофона
|
|
510
528
|
*/
|
|
@@ -960,6 +978,10 @@ export default abstract class Params {
|
|
|
960
978
|
static get displaySurface(): DisplayCaptureSurfaceType;
|
|
961
979
|
static get audioEffects(): EffectVoiceChange | null;
|
|
962
980
|
static set audioEffects(value: EffectVoiceChange | null);
|
|
981
|
+
static get vad(): VadLib | null;
|
|
982
|
+
static set vad(value: VadLib | null);
|
|
983
|
+
static get vadOptions(): VadControllerOptions;
|
|
984
|
+
static set vadOptions(value: VadControllerOptions);
|
|
963
985
|
static get videoEffects(): VideoEffects | null;
|
|
964
986
|
static set videoEffects(value: VideoEffects | null);
|
|
965
987
|
static get videoEffectMaxWidth(): number;
|
|
@@ -1027,6 +1049,8 @@ export default abstract class Params {
|
|
|
1027
1049
|
static get waitForRecordResponse(): boolean;
|
|
1028
1050
|
static get transparentAudio(): boolean;
|
|
1029
1051
|
static get enableSessionStateUpdates(): boolean;
|
|
1052
|
+
static get safariAudioElement(): boolean;
|
|
1053
|
+
static get forwardEmptyIceCandidate(): boolean;
|
|
1030
1054
|
static toJSON(): {
|
|
1031
1055
|
apiKey: string;
|
|
1032
1056
|
apiEnv: string;
|
|
@@ -1063,5 +1087,7 @@ export default abstract class Params {
|
|
|
1063
1087
|
waitForRecordResponse: boolean;
|
|
1064
1088
|
transparentAudio: boolean;
|
|
1065
1089
|
enableSessionStateUpdates: boolean;
|
|
1090
|
+
safariAudioElement: boolean;
|
|
1091
|
+
forwardEmptyIceCandidate: boolean;
|
|
1066
1092
|
};
|
|
1067
1093
|
}
|
|
@@ -11,6 +11,7 @@ declare namespace ParticipantConnectionStatusUtils {
|
|
|
11
11
|
function computeEffective(status: ParticipantConnectionStatus): ParticipantStatus;
|
|
12
12
|
function setSessionState(status: ParticipantConnectionStatus, sessionState?: ParticipantSessionState, sessionStateConnectedBySpeaker?: boolean): StatusTransition;
|
|
13
13
|
function setTransport(status: ParticipantConnectionStatus, transport: ParticipantStatus): StatusTransition;
|
|
14
|
+
function setStalled(status: ParticipantConnectionStatus, stalled: boolean): StatusTransition;
|
|
14
15
|
function setSessionStateApplicable(status: ParticipantConnectionStatus, applicable: boolean): StatusTransition;
|
|
15
16
|
}
|
|
16
17
|
export default ParticipantConnectionStatusUtils;
|
package/static/Sdp.d.ts
ADDED
|
@@ -6,8 +6,10 @@ export declare const SIMULCAST_DEFAULT: {
|
|
|
6
6
|
BITRATE: number;
|
|
7
7
|
};
|
|
8
8
|
export declare const SIMULCAST_SCALABILITY_MODE = "L1T2";
|
|
9
|
-
export declare const MAP_RID_TO_SCALE_RESOLUTION_DOWN_BY: Record<string, number>;
|
|
10
9
|
export declare function isEqualSimulcastInfo(si1: ISimulcastInfo | null, si2: ISimulcastInfo | null): boolean;
|
|
11
10
|
export declare function findBitrateAsc(maxDimension: number, bitrates: VideoBitrateSettings[]): number;
|
|
12
|
-
export declare function calculateSimulcastInfo(width?: number, height?: number, bitrates?: VideoBitrateSettings[]):
|
|
13
|
-
|
|
11
|
+
export declare function calculateSimulcastInfo(width?: number, height?: number, bitrates?: VideoBitrateSettings[], fps?: number): {
|
|
12
|
+
streams: import("../types/SimulcastInfo").SimulcastStreamInfo[];
|
|
13
|
+
};
|
|
14
|
+
export declare function findScaleResolutionDownBy(rid: string | undefined, simulcastInfo: ISimulcastInfo): number;
|
|
15
|
+
export declare function applySimulcastInfoToEncodings(encodings: RTCRtpEncodingParameters[], simulcastInfo: ISimulcastInfo, maxDimension?: number, maxBitrate?: number): void;
|
package/static/Utils.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const DEVICE_IDX_PARAMETER = "d";
|
|
|
9
9
|
/** @hidden */
|
|
10
10
|
declare namespace Utils {
|
|
11
11
|
function patchLocalSDP(sdp: string, preferH264: boolean, brokenH264Decoder: boolean, preferVP9: boolean, isAudioNack?: boolean): string;
|
|
12
|
-
function patchRemoteSDP(sdp: string,
|
|
12
|
+
function patchRemoteSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, brokenVP9Encoder: boolean, brokenVP9Decoder: boolean): string;
|
|
13
13
|
function getPeerIdString(peerId: SignalingMessage.PeerId): string;
|
|
14
14
|
function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
|
|
15
15
|
function getPeerConnectionHostInfo(pc: RTCPeerConnection): Promise<{
|
|
@@ -77,6 +77,5 @@ declare namespace Utils {
|
|
|
77
77
|
function objectReduce<R, T extends object>(obj: T, callback: (acc: R, value: T[keyof T], key: keyof T) => R, initialValue: R): R;
|
|
78
78
|
const setImmediate: (fn: VoidFunction) => VoidFunction;
|
|
79
79
|
function isObject(obj: unknown): obj is object;
|
|
80
|
-
function patchSimulcastAnswerSdp(sdp: string, trans: RTCRtpTransceiver, width: number, height: number): string;
|
|
81
80
|
}
|
|
82
81
|
export default Utils;
|
package/static/WebRTCUtils.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare enum FacingMode {
|
|
|
20
20
|
/**
|
|
21
21
|
* Известные браузеры
|
|
22
22
|
*/
|
|
23
|
-
export type BrowserName = '
|
|
23
|
+
export type BrowserName = 'Edge' | 'Chrome' | 'Firefox' | 'Yandex' | 'Opera' | 'Sferum';
|
|
24
24
|
declare namespace WebRTCUtils {
|
|
25
25
|
/**
|
|
26
26
|
* До вызова этого метода бесполезно опрашивать другие публичные методы.
|
|
@@ -143,17 +143,14 @@ declare namespace WebRTCUtils {
|
|
|
143
143
|
* В некоторых браузерах VP9 decoder сломан
|
|
144
144
|
*/
|
|
145
145
|
function isBrokenVP9Decoder(): boolean;
|
|
146
|
-
/**
|
|
147
|
-
* Изменился формат описания датаканала в SDP
|
|
148
|
-
* @link https://blog.mozilla.org/webrtc/how-to-avoid-data-channel-breaking/
|
|
149
|
-
*/
|
|
150
|
-
function isOldDataChannelDescription(): boolean;
|
|
151
146
|
/**
|
|
152
147
|
* Может ли браузер делать H264 приоритетным
|
|
153
148
|
*/
|
|
154
149
|
function canPreferH264(): boolean;
|
|
155
150
|
/**
|
|
156
|
-
*
|
|
151
|
+
* Поддержка simulcast браузером.
|
|
152
|
+
* Safari корректно поддерживает simulcast начиная с версии 18.
|
|
153
|
+
* Firefox поддерживает simulcast с VP8 начиная с версии 134.
|
|
157
154
|
*/
|
|
158
155
|
function isSimulcastSupportedByBrowser(): boolean;
|
|
159
156
|
/**
|
package/types/Api.d.ts
ADDED
package/types/Capabilities.d.ts
CHANGED
package/types/Participant.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export interface ParticipantSessionState {
|
|
|
49
49
|
}
|
|
50
50
|
export interface ParticipantConnectionStatus {
|
|
51
51
|
transport: ParticipantStatus;
|
|
52
|
+
stalled: boolean;
|
|
52
53
|
sessionState?: ParticipantSessionState;
|
|
53
54
|
sessionStateApplicable: boolean;
|
|
54
55
|
sessionStateConnectedBySpeaker: boolean;
|
|
@@ -24,10 +24,6 @@ export interface CallStatReport {
|
|
|
24
24
|
audio_concealment_events: number;
|
|
25
25
|
inbound_video_count: number;
|
|
26
26
|
inbound_audio_count: number;
|
|
27
|
-
packets_lost_video: number;
|
|
28
|
-
packets_sent_video: number;
|
|
29
|
-
packets_lost_audio: number;
|
|
30
|
-
packets_sent_audio: number;
|
|
31
27
|
freeze_count: number;
|
|
32
28
|
total_freezes_duration: number;
|
|
33
29
|
rtt: number;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import SignalingCommandType from '../enums/SignalingCommandType';
|
|
2
2
|
import { SignalingResponse, SignalingSuccessResponse } from './SignalingMessage';
|
|
3
|
+
export type SignalingCommandRoute = 'websocket' | 'producer';
|
|
3
4
|
interface SignalingCommand<T extends SignalingResponse = SignalingSuccessResponse> {
|
|
4
5
|
sequence: number;
|
|
5
6
|
name: SignalingCommandType;
|
|
7
|
+
route: SignalingCommandRoute;
|
|
6
8
|
statMarkName: string;
|
|
7
9
|
params: object;
|
|
8
10
|
responseTimer: number;
|
|
@@ -2,8 +2,8 @@ type Device = 'camera' | 'microphone';
|
|
|
2
2
|
type PermissionStatusState = typeof PermissionStatus.prototype.state;
|
|
3
3
|
type EventListener = (name: Device, state: PermissionStatusState) => void;
|
|
4
4
|
export declare class NavigatorPermissions {
|
|
5
|
-
private _cameraPermissionStatus
|
|
6
|
-
private _microphonePermissionStatus
|
|
5
|
+
private _cameraPermissionStatus?;
|
|
6
|
+
private _microphonePermissionStatus?;
|
|
7
7
|
private _listener;
|
|
8
8
|
static isSupported(): boolean;
|
|
9
9
|
init(listener: EventListener): Promise<void>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Последовательно выполняет операции, оставляя в очереди только последнее запрошенное значение.
|
|
3
|
+
* Возвращает ошибку, только если не удалось применить итоговое состояние.
|
|
4
|
+
*/
|
|
5
|
+
export declare function serializeLatest<T>(run: (value: T) => Promise<void> | undefined): (value: T) => Promise<void>;
|