@vkontakte/calls-sdk 2.8.13-dev.7195a780.0 → 2.8.13-dev.7452edd3.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 +40 -14
- package/abstract/BaseApi.d.ts +21 -19
- package/calls-sdk.cjs.js +7 -7
- package/calls-sdk.esm.js +5075 -3335
- package/classes/AudioFix.d.ts +2 -2
- package/classes/AudioOutput.d.ts +5 -3
- package/classes/CallRegistry.d.ts +17 -4
- package/classes/ExternalIdCache.d.ts +9 -13
- package/classes/MediaSource.d.ts +11 -2
- package/classes/SpecListener.d.ts +2 -2
- package/classes/StatsLogger.d.ts +1 -1
- package/classes/VolumesDetector.d.ts +0 -1
- package/classes/codec/LibVPxDecoder.d.ts +2 -2
- package/classes/codec/LibVPxEncoder.d.ts +2 -2
- package/classes/codec/WebCodecsDecoder.d.ts +2 -2
- package/classes/codec/WebCodecsEncoder.d.ts +2 -2
- package/classes/codec/WorkerBase.d.ts +3 -3
- package/classes/conversation/Conversation.d.ts +36 -11
- package/classes/conversation/Conversation.testUtils.d.ts +3 -0
- package/classes/conversation/DisplayLayoutRequester.d.ts +3 -1
- package/classes/screenshare/ScreenCaptureReceiver.d.ts +2 -2
- package/classes/screenshare/ScreenCaptureSender.d.ts +2 -2
- package/classes/screenshare/StreamBuilder.d.ts +3 -2
- package/classes/stat/ApiCallStats.d.ts +12 -0
- package/classes/stat/BatteryStats.d.ts +25 -0
- package/classes/stat/CallLifecycleStats.d.ts +7 -2
- package/classes/stat/CallStatTail.d.ts +76 -0
- package/classes/stat/ClientResourceStats.d.ts +41 -0
- package/classes/stat/CodecStatsAggregator.d.ts +5 -2
- package/classes/stat/ConversationStats.d.ts +24 -3
- package/classes/stat/NetworkAdaptationStats.d.ts +35 -0
- package/classes/stat/PeerConnectionStats.d.ts +22 -0
- package/classes/stat/SdpStats.d.ts +40 -0
- package/classes/stat/Stat.testUtils.d.ts +17 -0
- package/classes/stat/StatAggregator.d.ts +12 -3
- package/classes/stat/StatClock.d.ts +28 -0
- package/classes/stat/StatDrainScheduler.d.ts +113 -0
- package/classes/stat/StatEventCollector.d.ts +57 -0
- package/classes/stat/StatPings.d.ts +6 -2
- package/classes/stat/StatQueue.d.ts +119 -0
- package/classes/stat/StatSignalingCommands.d.ts +4 -2
- package/classes/transport/DirectTransport.d.ts +13 -2
- package/classes/transport/PerfStatReporter.d.ts +7 -1
- package/classes/transport/ServerTransport.d.ts +6 -2
- package/classes/transport/SimulcastSender.d.ts +2 -2
- package/classes/transport/Transport.d.ts +2 -2
- package/default/Api.d.ts +21 -11
- package/default/Signaling.d.ts +11 -3
- package/default/SignalingTransport.d.ts +5 -1
- package/enums/ActiveFeature.d.ts +19 -0
- package/enums/SessionError.d.ts +10 -0
- package/enums/Stat.d.ts +26 -1
- package/package.json +1 -1
- package/static/ApiTransport.d.ts +4 -0
- package/static/AuthData.d.ts +11 -1
- package/static/BrowserEnvironment.d.ts +90 -0
- package/static/External.d.ts +21 -0
- package/static/Params.d.ts +79 -3
- package/static/SessionStore.d.ts +29 -0
- package/static/SimulcastInfo.d.ts +1 -0
- package/static/WebRTCUtils.d.ts +5 -76
- package/types/ClientStatsEvent.d.ts +12 -0
- package/types/FastHangup.d.ts +7 -5
- package/types/IEventualStatLog.d.ts +1 -1
- package/types/Params.d.ts +1 -1
- package/types/PerfStatReporter.d.ts +26 -1
- package/types/SignalingMessage.d.ts +1 -0
- package/types/Statistics.d.ts +22 -7
package/classes/AudioFix.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DebugLogger } from '../static/Debug';
|
|
2
|
-
import
|
|
2
|
+
import StatEventCollector from './stat/StatEventCollector';
|
|
3
3
|
import { MediaSource } from './MediaSource';
|
|
4
4
|
export default class AudioFix {
|
|
5
5
|
private _fixNoPacketsApplied;
|
|
@@ -15,7 +15,7 @@ export default class AudioFix {
|
|
|
15
15
|
private _lastPacketsSentTime;
|
|
16
16
|
private _toggleAudioPromise;
|
|
17
17
|
private _fixNoPacketsAppliedVideo;
|
|
18
|
-
constructor(mediaSource: MediaSource, debug?: DebugLogger, logger?:
|
|
18
|
+
constructor(mediaSource: MediaSource, debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
19
19
|
private _fixAudioDeviceNoPackets;
|
|
20
20
|
private _fixAudioDeviceTooManyPackets;
|
|
21
21
|
fix(rtps: any[]): void;
|
package/classes/AudioOutput.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DebugLogger } from '../static/Debug';
|
|
2
2
|
import { ParticipantId } from '../types/Participant';
|
|
3
|
-
import
|
|
3
|
+
import StatEventCollector from './stat/StatEventCollector';
|
|
4
4
|
import { StatFirstMediaReceived } from './stat/StatFirstMediaReceived';
|
|
5
5
|
/**
|
|
6
6
|
* Единый AudioOutput поддерживающий p2p, audioMix и transparent-audio
|
|
@@ -8,14 +8,15 @@ import { StatFirstMediaReceived } from './stat/StatFirstMediaReceived';
|
|
|
8
8
|
export default class AudioOutput {
|
|
9
9
|
protected _audioElement: HTMLAudioElement | null;
|
|
10
10
|
protected readonly _debug: DebugLogger;
|
|
11
|
-
private
|
|
11
|
+
private _preparedAudioElement;
|
|
12
12
|
private _audioTracks;
|
|
13
13
|
private readonly _allowMultipleTracks;
|
|
14
14
|
private _volume;
|
|
15
15
|
private readonly _features;
|
|
16
16
|
private readonly _statFirstMediaReceived;
|
|
17
17
|
private readonly _logger;
|
|
18
|
-
|
|
18
|
+
private _autoplayRecoveryController;
|
|
19
|
+
constructor(statFirstMediaReceived: StatFirstMediaReceived, allowMultipleTracks?: boolean, debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
19
20
|
add(participantId: ParticipantId, track: MediaStreamTrack): void;
|
|
20
21
|
remove(participantId: ParticipantId, track: MediaStreamTrack): void;
|
|
21
22
|
get volume(): number;
|
|
@@ -26,6 +27,7 @@ export default class AudioOutput {
|
|
|
26
27
|
protected _getTracks(): MediaStreamTrack[];
|
|
27
28
|
protected _initAudioElement(): void;
|
|
28
29
|
protected _stopAudioElement(): void;
|
|
30
|
+
private _stopAutoplayRecovery;
|
|
29
31
|
private _createAudioElement;
|
|
30
32
|
private _prepareAudioElement;
|
|
31
33
|
private _addTrackToAudioElement;
|
|
@@ -6,18 +6,31 @@ export interface HoldableConversation extends Conversation {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class CallRegistry {
|
|
8
8
|
private _conversations;
|
|
9
|
-
private
|
|
9
|
+
private _pending;
|
|
10
|
+
private _initialIds;
|
|
11
|
+
private _hangups;
|
|
10
12
|
private _activeId;
|
|
13
|
+
private _selected;
|
|
11
14
|
private _mutex;
|
|
12
15
|
private _pendingRemovals;
|
|
13
|
-
|
|
16
|
+
addPending(conversation: HoldableConversation): void;
|
|
17
|
+
selectPending(conversation: HoldableConversation): HoldableConversation | null;
|
|
18
|
+
isSelected(conversation: HoldableConversation): boolean;
|
|
19
|
+
releaseSelection(conversation: HoldableConversation, previous?: HoldableConversation | null): void;
|
|
20
|
+
selectIfNone(conversation: HoldableConversation): void;
|
|
14
21
|
add(conversation: HoldableConversation): void;
|
|
15
|
-
remove(
|
|
22
|
+
remove(conversation: HoldableConversation): void;
|
|
16
23
|
get(id: string): HoldableConversation | undefined;
|
|
24
|
+
getPending(id?: string): HoldableConversation | null;
|
|
25
|
+
isPending(conversation: HoldableConversation): boolean;
|
|
26
|
+
getLocal(id?: string): HoldableConversation | null;
|
|
27
|
+
trackHangup(conversation: HoldableConversation, promise: Promise<void>): void;
|
|
28
|
+
getHangup(id?: string): Promise<void> | undefined;
|
|
29
|
+
removeHangup(promise: Promise<void>): void;
|
|
17
30
|
getActive(): HoldableConversation | null;
|
|
18
31
|
getFirst(): HoldableConversation | null;
|
|
19
32
|
getActiveId(): string | null;
|
|
20
|
-
has(id: string): boolean;
|
|
33
|
+
has(id: string, except?: HoldableConversation): boolean;
|
|
21
34
|
getAll(): HoldableConversation[];
|
|
22
35
|
get callsLength(): number;
|
|
23
36
|
setActive(id: string): Promise<void>;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { ExternalId, ExternalParticipantId } from '../types/ExternalId';
|
|
2
|
-
import {
|
|
2
|
+
import { ParticipantId } from '../types/Participant';
|
|
3
3
|
export declare class ExternalIdCache {
|
|
4
4
|
private static _normalizeType;
|
|
5
|
-
private
|
|
6
|
-
private
|
|
5
|
+
private _participantIdToExternalId;
|
|
6
|
+
private _externalIdToParticipantId;
|
|
7
7
|
private _decorativeIdToInitialId;
|
|
8
8
|
private _initialIdToDecorativeId;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
unmapDecorativeId(initialId: OkUserId | CompositeUserId | ParticipantId): void;
|
|
16
|
-
getDecorativeIdByInitialId(initialId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
|
|
17
|
-
replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
|
|
18
|
-
getParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
9
|
+
getExternalId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
10
|
+
getParticipantId(externalId: ExternalId): ParticipantId | null;
|
|
11
|
+
cache(participantId: ParticipantId, externalId: ExternalParticipantId): void;
|
|
12
|
+
mapDecorativeId(decorativeId: ParticipantId, initialId: ParticipantId): void;
|
|
13
|
+
unmapDecorativeId(initialId: ParticipantId): void;
|
|
14
|
+
getDecorativeIdByInitialId(initialId: ParticipantId): ParticipantId | undefined;
|
|
19
15
|
clear(): void;
|
|
20
16
|
}
|
package/classes/MediaSource.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { IEffect } from '@vkontakte/calls-video-effects';
|
|
2
2
|
import EventEmitter from '../classes/EventEmitter';
|
|
3
|
+
import ActiveFeature from '../enums/ActiveFeature';
|
|
3
4
|
import MediaOption from '../enums/MediaOption';
|
|
4
5
|
import { type DebugLogger } from '../static/Debug';
|
|
5
6
|
import MediaSettings, { IVideoDimentions } from '../types/MediaSettings';
|
|
6
7
|
import { ScreenCaptureSettings } from '../types/ScreenCaptureSettings';
|
|
7
|
-
import
|
|
8
|
+
import StatEventCollector from './stat/StatEventCollector';
|
|
8
9
|
export declare const enum MediaSourceEvent {
|
|
9
10
|
SOURCE_CHANGED = "SOURCE_CHANGED",
|
|
10
11
|
SOURCE_READY = "SOURCE_READY",
|
|
@@ -38,6 +39,8 @@ export declare class MediaSource extends EventEmitter {
|
|
|
38
39
|
private _screenTrack;
|
|
39
40
|
private _audioShareTrack;
|
|
40
41
|
private _screenShareTrack;
|
|
42
|
+
private _screenCaptureRequest;
|
|
43
|
+
private _destroyed;
|
|
41
44
|
/** Трек для отправки в медиа-канал. Может отличаться при скриншаринге в дата-канал */
|
|
42
45
|
private _sendVideoTrack;
|
|
43
46
|
/** Трек с камеры. В стриме будет другой трек при включенных видео эффектах */
|
|
@@ -60,7 +63,9 @@ export declare class MediaSource extends EventEmitter {
|
|
|
60
63
|
private readonly _logger;
|
|
61
64
|
private _cameraTrackSetAt;
|
|
62
65
|
private _cameraMuteRecoveredAt;
|
|
63
|
-
|
|
66
|
+
private _micTrackSetAt;
|
|
67
|
+
private _micMuteRecoveredAt;
|
|
68
|
+
constructor(debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
64
69
|
get cameraVideoTrack(): MediaStreamTrack | null;
|
|
65
70
|
set cameraVideoTrack(track: MediaStreamTrack | null);
|
|
66
71
|
request(mediaOptions?: MediaOption[], needEmptyTracks?: boolean): Promise<void>;
|
|
@@ -75,6 +80,8 @@ export declare class MediaSource extends EventEmitter {
|
|
|
75
80
|
*/
|
|
76
81
|
getMediaSettings(): MediaSettings;
|
|
77
82
|
get mediaSettings(): MediaSettings;
|
|
83
|
+
/** Что сейчас включено у пользователя — для метрики active_features */
|
|
84
|
+
get activeFeatures(): ActiveFeature[];
|
|
78
85
|
changeDevice(kind: MediaDeviceKind): Promise<void>;
|
|
79
86
|
/**
|
|
80
87
|
* Установка кастомного стрима для видео, например внешний шаринг экрана
|
|
@@ -83,6 +90,7 @@ export declare class MediaSource extends EventEmitter {
|
|
|
83
90
|
* @hidden
|
|
84
91
|
*/
|
|
85
92
|
setVideoStream(stream: MediaStream, isScreen: boolean): Promise<void>;
|
|
93
|
+
private _setMicAudioTrack;
|
|
86
94
|
private _initDeviceChangeListener;
|
|
87
95
|
private _destroyDeviceChangeListener;
|
|
88
96
|
private _changeVideoInput;
|
|
@@ -109,6 +117,7 @@ export declare class MediaSource extends EventEmitter {
|
|
|
109
117
|
toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
|
|
110
118
|
disableScreenCapturing(): Promise<void>;
|
|
111
119
|
private videoTrackMuteHandler;
|
|
120
|
+
private micTrackMuteHandler;
|
|
112
121
|
toggleVideo(enabled: boolean): Promise<void>;
|
|
113
122
|
toggleAudio(enabled: boolean): Promise<void>;
|
|
114
123
|
toggleAnimojiCapturing(enabled: boolean): void;
|
|
@@ -2,7 +2,7 @@ import { type DebugLogger } from '../static/Debug';
|
|
|
2
2
|
import MediaSettings from '../types/MediaSettings';
|
|
3
3
|
import { Participant, ParticipantId } from '../types/Participant';
|
|
4
4
|
import EventEmitter from './EventEmitter';
|
|
5
|
-
import
|
|
5
|
+
import StatEventCollector from './stat/StatEventCollector';
|
|
6
6
|
import { Transport } from './transport/Transport';
|
|
7
7
|
import { VolumesDetector } from './VolumesDetector';
|
|
8
8
|
export default class SpecListener extends EventEmitter {
|
|
@@ -14,7 +14,7 @@ export default class SpecListener extends EventEmitter {
|
|
|
14
14
|
private _connectionTimeout;
|
|
15
15
|
private _connectionTimeoutSuppressed;
|
|
16
16
|
private _volumeTimeout;
|
|
17
|
-
constructor(transport: Transport, volumesDetector: VolumesDetector, participants: Record<ParticipantId, Participant>, debug?: DebugLogger, logger?:
|
|
17
|
+
constructor(transport: Transport, volumesDetector: VolumesDetector, participants: Record<ParticipantId, Participant>, debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
18
18
|
destroy(): void;
|
|
19
19
|
onChangeRemoteMediaSettings(participantId: ParticipantId, mediaSettings: MediaSettings): void;
|
|
20
20
|
onParticipantHoldChanged(): void;
|
package/classes/StatsLogger.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import BaseApi from '../abstract/BaseApi';
|
|
|
2
2
|
import BaseLogger from '../abstract/BaseLogger';
|
|
3
3
|
import StatLog from '../enums/StatLog';
|
|
4
4
|
import TransportTopology from '../enums/TransportTopology';
|
|
5
|
-
type ClientStatsPayload = Record<string, string | number | boolean | undefined | null>;
|
|
5
|
+
type ClientStatsPayload = Record<string, string | string[] | number | boolean | undefined | null>;
|
|
6
6
|
export type LogClientStatsOptions = {
|
|
7
7
|
immediately?: boolean;
|
|
8
8
|
occurredAt?: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type DebugLogger } from '../../static/Debug';
|
|
2
|
-
import
|
|
2
|
+
import StatEventCollector from '../stat/StatEventCollector';
|
|
3
3
|
import IDecoder from './IDecoder';
|
|
4
4
|
import WorkerBase from './WorkerBase';
|
|
5
5
|
export default class LibVPxDecoder extends WorkerBase implements IDecoder {
|
|
6
|
-
constructor(debug?: DebugLogger, logger?:
|
|
6
|
+
constructor(debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
7
7
|
init(onFrameImage: (image: ImageData) => void, onFrameError: (error: unknown) => void, onKeyFrameRequested: () => void): Promise<void>;
|
|
8
8
|
decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
|
|
9
9
|
destroy(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DebugLogger } from '../../static/Debug';
|
|
2
|
-
import
|
|
2
|
+
import StatEventCollector from '../stat/StatEventCollector';
|
|
3
3
|
import IEncoder from './IEncoder';
|
|
4
4
|
import { OnFrameCallback } from './Types';
|
|
5
5
|
import WorkerBase from './WorkerBase';
|
|
@@ -15,7 +15,7 @@ export default class LibVPxEncoder extends WorkerBase implements IEncoder {
|
|
|
15
15
|
private _canvasCtx;
|
|
16
16
|
private _frameReadTimeout;
|
|
17
17
|
private _lastFrame;
|
|
18
|
-
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, debug?: DebugLogger, logger?:
|
|
18
|
+
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
19
19
|
private _createDom;
|
|
20
20
|
private _removeDom;
|
|
21
21
|
private _createStream;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type DebugLogger } from '../../static/Debug';
|
|
2
|
-
import
|
|
2
|
+
import StatEventCollector from '../stat/StatEventCollector';
|
|
3
3
|
import IDecoder from './IDecoder';
|
|
4
4
|
import WorkerBase from './WorkerBase';
|
|
5
5
|
export default class WebCodecsDecoder extends WorkerBase implements IDecoder {
|
|
6
|
-
constructor(debug?: DebugLogger, logger?:
|
|
6
|
+
constructor(debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
7
7
|
init(onFrameImage: (frame: VideoFrame) => void, onFrameError: (error: unknown) => void, onKeyFrameRequested: () => void): Promise<void>;
|
|
8
8
|
decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
|
|
9
9
|
destroy(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DebugLogger } from '../../static/Debug';
|
|
2
|
-
import
|
|
2
|
+
import StatEventCollector from '../stat/StatEventCollector';
|
|
3
3
|
import IEncoder from './IEncoder';
|
|
4
4
|
import { OnFrameCallback } from './Types';
|
|
5
5
|
import WorkerBase from './WorkerBase';
|
|
@@ -11,7 +11,7 @@ export default class WebCodecsEncoder extends WorkerBase implements IEncoder {
|
|
|
11
11
|
private readonly _maxBitrate;
|
|
12
12
|
private readonly _useCbr;
|
|
13
13
|
private readonly _frameRate;
|
|
14
|
-
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, useCbr: boolean, frameRate: number, debug?: DebugLogger, logger?:
|
|
14
|
+
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, useCbr: boolean, frameRate: number, debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
15
15
|
init(): Promise<void>;
|
|
16
16
|
requestFrame(keyFrame?: boolean): void;
|
|
17
17
|
setBitrate(bitrate: number, useCbr: boolean, fps: number): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type DebugLogger } from '../../static/Debug';
|
|
2
|
-
import
|
|
2
|
+
import StatEventCollector from '../stat/StatEventCollector';
|
|
3
3
|
export default abstract class WorkerBase {
|
|
4
4
|
protected _worker: Worker | null;
|
|
5
5
|
protected readonly _debug: DebugLogger;
|
|
6
|
-
protected readonly _logger:
|
|
7
|
-
protected constructor(debug?: DebugLogger, logger?:
|
|
6
|
+
protected readonly _logger: StatEventCollector | null;
|
|
7
|
+
protected constructor(debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
8
8
|
protected _createWorker(workerFunctionData: string, onFrame: (data: any) => void, workerArgs?: any[], initArgs?: {
|
|
9
9
|
[key: string]: any;
|
|
10
10
|
}, transfer?: any[]): Promise<void>;
|
|
@@ -15,12 +15,12 @@ import { IAsrStartParams, IAsrStopParams } from '../../types/Asr';
|
|
|
15
15
|
import { AudienceModeHandsResponse } from '../../types/AudienceMode';
|
|
16
16
|
import { ConversationData, ConversationOnJoinParams, ConversationOnStartParams } from '../../types/Conversation';
|
|
17
17
|
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk } from '../../types/ExternalId';
|
|
18
|
-
import type {
|
|
18
|
+
import type { HangupParams } from '../../types/FastHangup';
|
|
19
19
|
import MediaModifiers from '../../types/MediaModifiers';
|
|
20
20
|
import MediaSettings, { IVideoDimentions } from '../../types/MediaSettings';
|
|
21
21
|
import { IAddMovieParams, IUpdateMovieData } from '../../types/MovieShare';
|
|
22
22
|
import MuteStates from '../../types/MuteStates';
|
|
23
|
-
import { CompositeUserId, IGetParticipantsParameters,
|
|
23
|
+
import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../../types/Participant';
|
|
24
24
|
import { DisplayLayoutRequest, ParticipantLayout } from '../../types/ParticipantLayout';
|
|
25
25
|
import { ParticipantListChunkParameters } from '../../types/ParticipantListChunk';
|
|
26
26
|
import ParticipantPriority from '../../types/ParticipantPriority';
|
|
@@ -35,6 +35,9 @@ export default class Conversation extends EventEmitter {
|
|
|
35
35
|
private readonly _signalingActor;
|
|
36
36
|
private readonly _displayLayoutRequester;
|
|
37
37
|
private _mediaSource;
|
|
38
|
+
private _requestingLocalMedia;
|
|
39
|
+
private _requestedLocalAudio?;
|
|
40
|
+
private _requestedLocalVideo?;
|
|
38
41
|
private _conversation;
|
|
39
42
|
private _myLastRequestedLayouts;
|
|
40
43
|
private _state;
|
|
@@ -56,15 +59,20 @@ export default class Conversation extends EventEmitter {
|
|
|
56
59
|
private _isRealTimeAsrRequested;
|
|
57
60
|
private _serverSettings;
|
|
58
61
|
private _serverTimeOffset;
|
|
59
|
-
private
|
|
62
|
+
private _serverConversationId;
|
|
60
63
|
private _onFastHangup?;
|
|
61
64
|
private _hangupEmitted;
|
|
62
65
|
private _hangupPromise;
|
|
66
|
+
private _hangupReason;
|
|
63
67
|
private _abortController;
|
|
64
68
|
private _registeredPeerReceived;
|
|
65
69
|
private _calleeUnavailableTimer;
|
|
66
|
-
private
|
|
70
|
+
private _pendingId;
|
|
71
|
+
private _resolveSignalingInitialization;
|
|
72
|
+
private readonly _signalingInitialization;
|
|
67
73
|
private readonly _onUnload;
|
|
74
|
+
private readonly _onRestore;
|
|
75
|
+
private readonly _onVisibilityChange;
|
|
68
76
|
private readonly _audioOutput;
|
|
69
77
|
private readonly _stats;
|
|
70
78
|
private _lastStalled;
|
|
@@ -79,18 +87,23 @@ export default class Conversation extends EventEmitter {
|
|
|
79
87
|
private readonly _statFirstMediaReceived;
|
|
80
88
|
constructor(api: BaseApi, externalLogger: BaseLogger | null);
|
|
81
89
|
static current(): Conversation | null;
|
|
82
|
-
static hangupAfterInit(onFastHangup?: FastHangupHandler): void;
|
|
83
90
|
static id(): string | null;
|
|
84
91
|
get id(): string;
|
|
85
92
|
get externalId(): ExternalParticipantId | undefined;
|
|
86
93
|
get mediaSettings(): MediaSettings | undefined;
|
|
87
94
|
get isCallHeld(): boolean;
|
|
95
|
+
get isIncomingRinging(): boolean;
|
|
88
96
|
static debugSessionId(): string | null;
|
|
89
97
|
static debugMessage(type: DebugMessageType, ...args: any[]): boolean;
|
|
90
98
|
static debugMessageWithContext(type: DebugMessageType, conversationId: string, ...args: any[]): boolean;
|
|
91
99
|
static getSyncedTime(): number;
|
|
92
100
|
get debugSessionId(): string | null;
|
|
93
|
-
|
|
101
|
+
getCachedParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
102
|
+
private _onNonFatalError;
|
|
103
|
+
/**
|
|
104
|
+
* Внешний id звонящего во входящем звонке, либо null, если звонящий не найден.
|
|
105
|
+
*/
|
|
106
|
+
getIncomingCallerExternalId(): ExternalParticipantId | null;
|
|
94
107
|
private _buildInternalParams;
|
|
95
108
|
onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
|
|
96
109
|
onJoin(joinArgs: ConversationOnJoinParams): Promise<ConversationData>;
|
|
@@ -109,7 +122,8 @@ export default class Conversation extends EventEmitter {
|
|
|
109
122
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
110
123
|
decline(params?: HangupParams): Promise<void>;
|
|
111
124
|
hangup(params?: HangupParams): Promise<void>;
|
|
112
|
-
|
|
125
|
+
private _waitForHangup;
|
|
126
|
+
addParticipant(participantIds: ExternalId[], params?: AddParticipantParams): Promise<ExternalParticipant[] | undefined>;
|
|
113
127
|
addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<void>;
|
|
114
128
|
removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<void>;
|
|
115
129
|
setVolume(volume: number): void;
|
|
@@ -117,11 +131,15 @@ export default class Conversation extends EventEmitter {
|
|
|
117
131
|
private _openTransport;
|
|
118
132
|
private _allocateParticipantTransport;
|
|
119
133
|
private _closeParticipantTransport;
|
|
134
|
+
private _registerPending;
|
|
120
135
|
private _cleanupRegistry;
|
|
136
|
+
private _applyInitialActiveSelection;
|
|
121
137
|
private _emitHangupOnce;
|
|
122
138
|
private _sendHangupApi;
|
|
123
139
|
private _close;
|
|
124
140
|
private _sendHangup;
|
|
141
|
+
private _throwIfClosed;
|
|
142
|
+
private _applyServerConversation;
|
|
125
143
|
destroy(): void;
|
|
126
144
|
private _destroy;
|
|
127
145
|
private _getConversationParams;
|
|
@@ -145,12 +163,15 @@ export default class Conversation extends EventEmitter {
|
|
|
145
163
|
private _cacheParticipantExternalIds;
|
|
146
164
|
private _setConversation;
|
|
147
165
|
private _updateConversation;
|
|
166
|
+
private _requestLocalMedia;
|
|
148
167
|
private _createMediaSource;
|
|
149
168
|
private _connectSignaling;
|
|
169
|
+
private _completeSignalingInitialization;
|
|
150
170
|
private _processConnection;
|
|
151
171
|
private _onConversationParticipantListChunk;
|
|
152
172
|
private _createParticipantListChunk;
|
|
153
173
|
private _participantListChunkToExternalChunk;
|
|
174
|
+
private _participantsToExternal;
|
|
154
175
|
private _registerConnectionParticipants;
|
|
155
176
|
private _registerParticipants;
|
|
156
177
|
/** Установим состояние локальных мьютов */
|
|
@@ -164,8 +185,9 @@ export default class Conversation extends EventEmitter {
|
|
|
164
185
|
private _registerParticipantInCache;
|
|
165
186
|
private _getExistedParticipantByIdOrCreate;
|
|
166
187
|
private _getExternalIdByParticipantId;
|
|
167
|
-
private
|
|
168
|
-
private
|
|
188
|
+
private _getExternalIdsByParticipantIds;
|
|
189
|
+
private _reportMissingExternalIds;
|
|
190
|
+
private _reportMissingExternalIdsById;
|
|
169
191
|
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
170
192
|
private _warnParticipantNotInConversation;
|
|
171
193
|
private _denormalizeMarkers;
|
|
@@ -444,6 +466,11 @@ export default class Conversation extends EventEmitter {
|
|
|
444
466
|
private _onVideoSuspendSuggest;
|
|
445
467
|
private _onParticipantHold;
|
|
446
468
|
private _isMe;
|
|
469
|
+
/**
|
|
470
|
+
* Сколько человек сейчас в звонке. Считаем только принявших: приглашенные,
|
|
471
|
+
* у которых еще идет вызов, ресурсы не потребляют.
|
|
472
|
+
*/
|
|
473
|
+
private _getParticipantsCount;
|
|
447
474
|
private _getMuteStatesForRoomId;
|
|
448
475
|
private _getMuteStatesForCurrentRoom;
|
|
449
476
|
private _setMuteStatesForRoomId;
|
|
@@ -451,8 +478,6 @@ export default class Conversation extends EventEmitter {
|
|
|
451
478
|
private _registerParticipant;
|
|
452
479
|
private _getParticipant;
|
|
453
480
|
}
|
|
454
|
-
declare function _resetPendingInstance(): void;
|
|
455
|
-
export { _resetPendingInstance };
|
|
456
481
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
457
482
|
readonly participantErrors: {
|
|
458
483
|
externalId: ExternalParticipantId;
|
|
@@ -35,6 +35,9 @@ declare function createParams(): {
|
|
|
35
35
|
onChatRoomUpdated: Mock<import("@vitest/spy").Procedure>;
|
|
36
36
|
onRemoteStatus: Mock<import("@vitest/spy").Procedure>;
|
|
37
37
|
onSpeakerChanged: Mock<import("@vitest/spy").Procedure>;
|
|
38
|
+
onAcceptedCall: Mock<import("@vitest/spy").Procedure>;
|
|
39
|
+
onNonFatalError: Mock<import("@vitest/spy").Procedure>;
|
|
40
|
+
onSignalingConnected: Mock<import("@vitest/spy").Procedure>;
|
|
38
41
|
};
|
|
39
42
|
export type ConversationTestParams = ReturnType<typeof createParams>;
|
|
40
43
|
export type ConversationTestTools = {
|
|
@@ -8,6 +8,7 @@ type DisplayLayoutRequesterParams = {
|
|
|
8
8
|
getParticipants: () => Record<ParticipantId, Participant>;
|
|
9
9
|
isMe: (participantId: ParticipantId) => boolean;
|
|
10
10
|
updateDisplayLayout: (layouts: ParticipantLayout[]) => Promise<void>;
|
|
11
|
+
onNonFatalError: (message: string) => void;
|
|
11
12
|
};
|
|
12
13
|
export default class DisplayLayoutRequester {
|
|
13
14
|
private readonly _api;
|
|
@@ -15,6 +16,7 @@ export default class DisplayLayoutRequester {
|
|
|
15
16
|
private readonly _getParticipants;
|
|
16
17
|
private readonly _isMe;
|
|
17
18
|
private readonly _updateDisplayLayout;
|
|
19
|
+
private readonly _onNonFatalError;
|
|
18
20
|
private _requestedLayouts;
|
|
19
21
|
private _uncertainLayouts;
|
|
20
22
|
private _pendingRequests;
|
|
@@ -25,7 +27,7 @@ export default class DisplayLayoutRequester {
|
|
|
25
27
|
private _lastFlushAt;
|
|
26
28
|
private _generation;
|
|
27
29
|
private _forceNextFlush;
|
|
28
|
-
constructor({ api, debug, getParticipants, isMe, updateDisplayLayout }: DisplayLayoutRequesterParams);
|
|
30
|
+
constructor({ api, debug, getParticipants, isMe, updateDisplayLayout, onNonFatalError }: DisplayLayoutRequesterParams);
|
|
29
31
|
request(requests: DisplayLayoutRequest[]): Promise<void>;
|
|
30
32
|
resend(): void;
|
|
31
33
|
cleanupParticipant(participantId: ParticipantId): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DebugLogger } from '../../static/Debug';
|
|
2
2
|
import { ParticipantId } from '../../types/Participant';
|
|
3
|
-
import
|
|
3
|
+
import StatEventCollector from '../stat/StatEventCollector';
|
|
4
4
|
import { ParticipantIdRegistry } from '../ParticipantIdRegistry';
|
|
5
5
|
import { StatAggregator } from '../stat/StatAggregator';
|
|
6
6
|
import { IOnStat } from './BaseStreamBuilder';
|
|
@@ -14,7 +14,7 @@ export default class ScreenCaptureReceiver {
|
|
|
14
14
|
private readonly _debug;
|
|
15
15
|
private readonly _logger;
|
|
16
16
|
private readonly _statAggregator;
|
|
17
|
-
constructor(datachannel: RTCDataChannel, participantIdRegistry: ParticipantIdRegistry, onStream: (streamId: string, stream: MediaStream) => void, onEos: (streamId: string) => void, onStat: IOnStat, statAggregator?: StatAggregator | null, debug?: DebugLogger, logger?:
|
|
17
|
+
constructor(datachannel: RTCDataChannel, participantIdRegistry: ParticipantIdRegistry, onStream: (streamId: string, stream: MediaStream) => void, onEos: (streamId: string) => void, onStat: IOnStat, statAggregator?: StatAggregator | null, debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
18
18
|
private _onDataChannelMessage;
|
|
19
19
|
/**
|
|
20
20
|
* Отправить запрос ключевого кадра в datachannel.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
2
|
import { type DebugLogger } from '../../static/Debug';
|
|
3
|
-
import
|
|
3
|
+
import StatEventCollector from '../stat/StatEventCollector';
|
|
4
4
|
export default class ScreenCaptureSender {
|
|
5
5
|
private readonly _encoder;
|
|
6
6
|
private readonly _datachannel;
|
|
@@ -25,7 +25,7 @@ export default class ScreenCaptureSender {
|
|
|
25
25
|
private readonly _maxFrameDelay;
|
|
26
26
|
private readonly _debug;
|
|
27
27
|
private readonly _logger;
|
|
28
|
-
constructor(track: MediaStreamTrack, datachannel: RTCDataChannel, signaling: BaseSignaling, fastSharing: boolean, debug?: DebugLogger, logger?:
|
|
28
|
+
constructor(track: MediaStreamTrack, datachannel: RTCDataChannel, signaling: BaseSignaling, fastSharing: boolean, debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
29
29
|
private _handleQueue;
|
|
30
30
|
/**
|
|
31
31
|
* Очищает очередь до опорного кадра
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DebugLogger } from '../../static/Debug';
|
|
2
2
|
import { ParticipantId } from '../../types/Participant';
|
|
3
|
-
import
|
|
3
|
+
import StatEventCollector from '../stat/StatEventCollector';
|
|
4
4
|
import { StatAggregator } from '../stat/StatAggregator';
|
|
5
5
|
import { BaseStreamBuilder, FrameData, IOnStat, IOnStream } from './BaseStreamBuilder';
|
|
6
6
|
export default class StreamBuilder extends BaseStreamBuilder {
|
|
@@ -9,9 +9,10 @@ export default class StreamBuilder extends BaseStreamBuilder {
|
|
|
9
9
|
private _decoderReady;
|
|
10
10
|
private _decoderBusy;
|
|
11
11
|
private _decoderQueue;
|
|
12
|
+
private _webCodecsRetryAttempted;
|
|
12
13
|
private _fpsMeter;
|
|
13
14
|
private readonly _logger;
|
|
14
|
-
constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat, statAggregator: StatAggregator | null, onKeyFrameRequested: VoidFunction, debug?: DebugLogger, logger?:
|
|
15
|
+
constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat, statAggregator: StatAggregator | null, onKeyFrameRequested: VoidFunction, debug?: DebugLogger, logger?: StatEventCollector | null);
|
|
15
16
|
protected _processFrame(frame: FrameData): void;
|
|
16
17
|
private _initFpsMeter;
|
|
17
18
|
/**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StatAggregator } from './StatAggregator';
|
|
2
|
+
/** Отправляет в стату время выполнения запросов к API */
|
|
3
|
+
export declare class ApiCallStats {
|
|
4
|
+
private readonly _statAggregator;
|
|
5
|
+
constructor(statAggregator: StatAggregator | null);
|
|
6
|
+
/**
|
|
7
|
+
* @param method название метода API, например `vchat.getConversationParams`
|
|
8
|
+
* @param duration время от запроса до ответа, мс
|
|
9
|
+
* @param error описание ошибки, если запрос не удался
|
|
10
|
+
*/
|
|
11
|
+
log(method: string, duration: number, error?: string): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import StatEventCollector from './StatEventCollector';
|
|
2
|
+
export interface BatteryClock {
|
|
3
|
+
monotonicNow(): number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Метрика battery_level_change: на каждое изменение уровня заряда отправляется
|
|
7
|
+
* само изменение в процентных пунктах и время, за которое оно произошло.
|
|
8
|
+
* Пока устройство на зарядке, замеры не ведутся: зарядка сбрасывает точку отсчёта,
|
|
9
|
+
* и первое изменение после неё только задаёт новую.
|
|
10
|
+
*
|
|
11
|
+
* Battery Status API есть только в Chromium, в Safari и Firefox его нет —
|
|
12
|
+
* там класс молча ничего не делает.
|
|
13
|
+
*/
|
|
14
|
+
export declare class BatteryStats {
|
|
15
|
+
private readonly _logger;
|
|
16
|
+
private readonly _clock;
|
|
17
|
+
private _battery;
|
|
18
|
+
private _previous;
|
|
19
|
+
private _destroyed;
|
|
20
|
+
constructor(logger: StatEventCollector, clock?: BatteryClock);
|
|
21
|
+
destroy(): void;
|
|
22
|
+
private _subscribe;
|
|
23
|
+
private _handleChargingChange;
|
|
24
|
+
private _handleLevelChange;
|
|
25
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import StatEventCollector from './StatEventCollector';
|
|
2
|
+
import { CallStatTail } from './CallStatTail';
|
|
2
3
|
export type CallLifecycleSource = 'outgoing' | 'incoming' | 'join' | 'anonym_join';
|
|
3
4
|
export interface CallLifecycleInitializationParams {
|
|
4
5
|
source: CallLifecycleSource;
|
|
@@ -11,6 +12,8 @@ export interface CallLifecycleClock {
|
|
|
11
12
|
export declare class CallLifecycleStats {
|
|
12
13
|
private readonly _logger;
|
|
13
14
|
private readonly _clock;
|
|
15
|
+
/** Хвост звонка в очереди; null — выключен */
|
|
16
|
+
private readonly _tail;
|
|
14
17
|
private _conversationId;
|
|
15
18
|
private _callStartLabel;
|
|
16
19
|
private _lifecycleStartedAtMonotonic;
|
|
@@ -20,7 +23,7 @@ export declare class CallLifecycleStats {
|
|
|
20
23
|
private _firstMediaSent;
|
|
21
24
|
private _finished;
|
|
22
25
|
private _destroyed;
|
|
23
|
-
constructor(logger:
|
|
26
|
+
constructor(logger: StatEventCollector, clock?: CallLifecycleClock, tail?: CallStatTail | null);
|
|
24
27
|
get firstMediaSentReported(): boolean;
|
|
25
28
|
get terminated(): boolean;
|
|
26
29
|
markInitializationStarted({ source, conversationId }: CallLifecycleInitializationParams): void;
|
|
@@ -34,6 +37,8 @@ export declare class CallLifecycleStats {
|
|
|
34
37
|
destroy(): void;
|
|
35
38
|
private _canRecord;
|
|
36
39
|
private _durationSince;
|
|
40
|
+
/** Ведёт хвост звонка, когда известен conversationId. */
|
|
41
|
+
private _startTail;
|
|
37
42
|
private _finish;
|
|
38
43
|
private _ensureConversationId;
|
|
39
44
|
private _record;
|