@vkontakte/calls-sdk 2.8.11-dev.8e365e39.0 → 2.8.11-dev.a7bd7233.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.
@@ -0,0 +1,25 @@
1
+ import Conversation from './Conversation';
2
+ import MediaSettings from '../types/MediaSettings';
3
+ export interface HoldableConversation extends Conversation {
4
+ id: string;
5
+ hold(hold: boolean, lastActiveMediaSettings?: MediaSettings): Promise<void>;
6
+ }
7
+ export declare class CallRegistry {
8
+ private _conversations;
9
+ private _activeId;
10
+ private _mutex;
11
+ add(conversation: HoldableConversation): void;
12
+ remove(id: string | null): void;
13
+ get(id: string): HoldableConversation | undefined;
14
+ getActive(): HoldableConversation | null;
15
+ getActiveId(): string | null;
16
+ has(id: string): boolean;
17
+ getAll(): HoldableConversation[];
18
+ get callsLength(): number;
19
+ setActive(id: string): Promise<void>;
20
+ setHold(id: string): Promise<void>;
21
+ switchCall(id: string): Promise<void>;
22
+ clear(): void;
23
+ }
24
+ declare const callRegistry: CallRegistry;
25
+ export { callRegistry };
@@ -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 { IVideoDimentions } from '../types/MediaSettings';
19
+ import MediaSettings, { 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,6 +37,7 @@ export default class Conversation extends EventEmitter {
37
37
  private _conversation;
38
38
  private _myLastRequestedLayouts;
39
39
  private _state;
40
+ private _previousState;
40
41
  private _participantState;
41
42
  private _participants;
42
43
  private _pendingParticipants;
@@ -52,10 +53,8 @@ export default class Conversation extends EventEmitter {
52
53
  private _isRealTimeAsrRequested;
53
54
  private _serverSettings;
54
55
  private _serverTimeOffset;
55
- private static _current;
56
- private static _activationMutex;
57
- private static _delayedHangup;
58
- private static _abortController;
56
+ private _delayedHangup;
57
+ private _abortController;
59
58
  private readonly _onUnload;
60
59
  private readonly _audioOutput;
61
60
  private readonly _stats;
@@ -73,6 +72,10 @@ export default class Conversation extends EventEmitter {
73
72
  static current(): Conversation | null;
74
73
  static hangupAfterInit(): void;
75
74
  static id(): string | null;
75
+ get id(): string;
76
+ get externalId(): ExternalParticipantId | undefined;
77
+ get mediaSettings(): MediaSettings | undefined;
78
+ get isCallHeld(): boolean;
76
79
  static debugSessionId(): string | null;
77
80
  static getSyncedTime(): number;
78
81
  get debugSessionId(): string | null;
@@ -206,7 +209,7 @@ export default class Conversation extends EventEmitter {
206
209
  */
207
210
  changePriorities(priorities: ParticipantPriority[]): Promise<void>;
208
211
  changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<void>;
209
- hold(hold: boolean): Promise<void>;
212
+ hold(hold: boolean, lastActiveMediaSettings?: MediaSettings): Promise<void>;
210
213
  putHandsDown(): Promise<void>;
211
214
  requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
212
215
  requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
@@ -287,7 +290,6 @@ export default class Conversation extends EventEmitter {
287
290
  startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<undefined>;
288
291
  stopStream(roomId?: number | null, remove?: boolean): Promise<undefined>;
289
292
  publishStream(roomId?: number | null): Promise<undefined>;
290
- recordSetConf(king?: ParticipantId, pawns?: ParticipantId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
291
293
  getStreamInfo(): Promise<{
292
294
  movieId: any;
293
295
  preview: any;
@@ -352,6 +354,7 @@ export default class Conversation extends EventEmitter {
352
354
  private _onPinParticipant;
353
355
  private _onOptionsChanged;
354
356
  private _onNetworkStatus;
357
+ private _emitHeldParticipantsStatus;
355
358
  private _onRemoteStreamSecond;
356
359
  /**
357
360
  * Коллбек, вызывающийся при получении/остановке стрима от AnimojiReceiver
@@ -372,6 +375,7 @@ export default class Conversation extends EventEmitter {
372
375
  private _onSpeakerChanged;
373
376
  private _onTransportStateChanged;
374
377
  private _onTransportLocalStateChanged;
378
+ private _areTransportParticipantsOnHold;
375
379
  private _onRemoteTrackAdded;
376
380
  private _onRemoteTrackRemoved;
377
381
  private _removeAudioTrack;
@@ -401,6 +405,7 @@ export default class Conversation extends EventEmitter {
401
405
  private _onFeedback;
402
406
  private _onDecorativeParticipantIdChanged;
403
407
  private _onVideoSuspendSuggest;
408
+ private _onParticipantHold;
404
409
  private _isMe;
405
410
  private _getMuteStatesForRoomId;
406
411
  private _getMuteStatesForCurrentRoom;
@@ -410,6 +415,8 @@ export default class Conversation extends EventEmitter {
410
415
  private _getParticipants;
411
416
  private _getParticipant;
412
417
  }
418
+ declare function _resetPendingInstance(): void;
419
+ export { _resetPendingInstance };
413
420
  export declare class UpdateDisplayLayoutError extends Error {
414
421
  readonly participantErrors: {
415
422
  externalId: ExternalParticipantId;
@@ -0,0 +1,19 @@
1
+ import { ExternalId, ExternalParticipantId } from '../types/ExternalId';
2
+ import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
3
+ export declare class ExternalIdCache {
4
+ private _okIdToExternalId;
5
+ private _externalIdToOkId;
6
+ private _decorativeIdToInitialId;
7
+ private _initialIdToDecorativeId;
8
+ getOkId(externalId: ExternalId): OkUserId | null;
9
+ getExternalId(okId: OkUserId): ExternalParticipantId | null;
10
+ hasByExternalId(externalId: ExternalId): boolean;
11
+ hasByOkId(okId: OkUserId): boolean;
12
+ cache(participantId: OkUserId | CompositeUserId | ParticipantId, externalId: ExternalParticipantId): void;
13
+ mapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId, initialId: OkUserId | CompositeUserId | ParticipantId): void;
14
+ unmapDecorativeId(initialId: OkUserId | CompositeUserId | ParticipantId): void;
15
+ getDecorativeIdByInitialId(initialId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
16
+ replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
17
+ getParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
18
+ clear(): void;
19
+ }
@@ -47,6 +47,7 @@ export declare class MediaSource extends EventEmitter {
47
47
  /** Трек аудио эффектов. Не изменяется на протяжении всего времени */
48
48
  private _audioEffectsTrack;
49
49
  private _mediaSettings;
50
+ private _lastMediaSettings;
50
51
  private _videoStatusOnScreenCapturingEnabled;
51
52
  private _effect;
52
53
  private _audioEffectParams;
@@ -67,7 +68,11 @@ export declare class MediaSource extends EventEmitter {
67
68
  getSendAudioTrack(): MediaStreamTrack | null;
68
69
  get isAnimojiRequested(): boolean;
69
70
  addTrackToPeerConnection(pc: RTCPeerConnection, observer: boolean, noDataChannel: boolean): void;
71
+ /**
72
+ * @deprecated Используйте гетер mediaSettings
73
+ */
70
74
  getMediaSettings(): MediaSettings;
75
+ get mediaSettings(): MediaSettings;
71
76
  changeDevice(kind: MediaDeviceKind): Promise<void>;
72
77
  /**
73
78
  * Установка кастомного стрима для видео, например внешний шаринг экрана
@@ -95,6 +100,8 @@ export declare class MediaSource extends EventEmitter {
95
100
  private _setEffect;
96
101
  private _stopEffect;
97
102
  destroy(): void;
103
+ stopLocalMedia(): Promise<void>;
104
+ resumeLocalMedia(lastActiveMediaSettings?: MediaSettings): Promise<void>;
98
105
  toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
99
106
  disableScreenCapturing(): Promise<void>;
100
107
  private videoTrackMuteHandler;
@@ -12,12 +12,17 @@ export default class SpecListener extends EventEmitter {
12
12
  private readonly _debug;
13
13
  private readonly _logger;
14
14
  private _connectionTimeout;
15
+ private _connectionTimeoutSuppressed;
15
16
  private _volumeTimeout;
16
17
  constructor(transport: Transport, volumesDetector: VolumesDetector, participants: Record<ParticipantId, Participant>, debug?: DebugLogger, logger?: StatsLogger | null);
17
18
  destroy(): void;
18
19
  onChangeRemoteMediaSettings(participantId: ParticipantId, mediaSettings: MediaSettings): void;
20
+ onParticipantHoldChanged(): void;
21
+ private _getConnectionTimeout;
22
+ private _getVolumeTimeout;
19
23
  private _onTransportStateChanged;
20
24
  private _onVolumesDetected;
21
25
  private _onConnectionTimeout;
26
+ private _reportConnectionTimeout;
22
27
  private _onVolumeTimeout;
23
28
  }
package/default/Api.d.ts CHANGED
@@ -8,9 +8,7 @@ import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
8
8
  export default class Api extends BaseApi {
9
9
  private _userId;
10
10
  private _uuid;
11
- private _externalUidsCache;
12
- private _decorativeIdToInitialId;
13
- private _initialIdToDecorativeId;
11
+ private _idCache;
14
12
  private _callUnsafe;
15
13
  protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
16
14
  userId(participantId: ParticipantId): Promise<ExternalParticipantId>;
@@ -25,7 +23,7 @@ export default class Api extends BaseApi {
25
23
  audioOnly?: boolean;
26
24
  waitForAdmin?: boolean;
27
25
  closedConversation?: boolean;
28
- }, speakerIds?: OkUserId[]): Promise<ConversationResponse>;
26
+ }, externalIds?: ExternalId[]): Promise<ConversationResponse>;
29
27
  startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie, waitForAdmin }?: {
30
28
  onlyAdminCanShareMovie?: boolean;
31
29
  waitForAdmin?: boolean;
@@ -42,19 +40,13 @@ export default class Api extends BaseApi {
42
40
  }>;
43
41
  getAnonymTokenByLink(joinLink: string, username?: string): Promise<string>;
44
42
  joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
45
- /**
46
- * NB: Не сохраняет порядок возвращаемых ID
47
- * Этот метод принимает именно ExternalId, т.к. для OkUserId не принципиально наличие deviceIdx
48
- * @hidden
49
- */
50
- getOkIdsByExternalIds(externalIds: ExternalId[]): Promise<OkUserId[]>;
51
- getParticipantIdsByExternalIds(externalIds: ExternalId[]): Promise<Map<ExternalId, ParticipantId>>;
52
43
  /**
53
44
  * NB: Не сохраняет порядок возвращаемых ID
54
45
  * @hidden
55
46
  */
56
47
  getExternalIdsByOkIds(uids: OkUserId[]): Promise<ExternalParticipantId[]>;
57
48
  getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
49
+ getCachedRawOkIdByExternalId(externalId: ExternalId): OkUserId | null;
58
50
  cacheExternalId(participantId: OkUserId | CompositeUserId | ParticipantId, externalId: ExternalParticipantId): void;
59
51
  mapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId, initialId: OkUserId | CompositeUserId | ParticipantId): void;
60
52
  unmapDecorativeId(initialId: OkUserId | CompositeUserId | ParticipantId): void;
@@ -27,7 +27,7 @@ import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
27
27
  import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
28
28
  import { PerfStatReport } from '../types/PerfStatReporter';
29
29
  import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse, SignalingSuccessResponse } from '../types/SignalingMessage';
30
- import { IPublishStreamData, IRecordConfData, IStartStreamData, IStopStreamData } from '../types/Streams';
30
+ import { IPublishStreamData, IStartStreamData, IStopStreamData } from '../types/Streams';
31
31
  export default class Signaling extends BaseSignaling {
32
32
  private socket;
33
33
  protected sequence: number;
@@ -130,7 +130,6 @@ export default class Signaling extends BaseSignaling {
130
130
  startStream(data: IStartStreamData): Promise<SignalingMessage>;
131
131
  stopStream(data?: IStopStreamData): Promise<SignalingMessage>;
132
132
  publishStream(data?: IPublishStreamData): Promise<SignalingMessage>;
133
- recordSetConf(conf?: IRecordConfData): Promise<SignalingMessage>;
134
133
  getRecordStatus(): Promise<SignalingMessage>;
135
134
  switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
136
135
  requestRealloc(): Promise<SignalingMessage>;
@@ -50,6 +50,7 @@ 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"
53
+ VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest",
54
+ HOLD = "hold"
54
55
  }
55
56
  export default SignalingNotification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.11-dev.8e365e39.0",
3
+ "version": "2.8.11-dev.a7bd7233.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",
@@ -0,0 +1,5 @@
1
+ import { TCapabilities } from '../types/Capabilities';
2
+ declare namespace Capabilities {
3
+ function get(): TCapabilities;
4
+ }
5
+ export default Capabilities;