@vkontakte/calls-sdk 2.8.11-beta.5 → 2.8.11-beta.6

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,26 @@
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
+ getFirstHeld(): HoldableConversation | null;
16
+ getActiveId(): string | null;
17
+ has(id: string): boolean;
18
+ getAll(): HoldableConversation[];
19
+ get callsLength(): number;
20
+ setActive(id: string): Promise<void>;
21
+ setHold(id: string): Promise<void>;
22
+ switchCall(id: string): Promise<void>;
23
+ clear(): void;
24
+ }
25
+ declare const callRegistry: CallRegistry;
26
+ 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,9 @@ export default class Conversation extends EventEmitter {
37
37
  private _conversation;
38
38
  private _myLastRequestedLayouts;
39
39
  private _state;
40
+ private _previousState;
41
+ /** Если пользователь в зале ожидания, холд должен вызываться после промоута */
42
+ private _waitingHallHoldPending;
40
43
  private _participantState;
41
44
  private _participants;
42
45
  private _pendingParticipants;
@@ -52,10 +55,8 @@ export default class Conversation extends EventEmitter {
52
55
  private _isRealTimeAsrRequested;
53
56
  private _serverSettings;
54
57
  private _serverTimeOffset;
55
- private static _current;
56
- private static _activationMutex;
57
- private static _delayedHangup;
58
- private static _abortController;
58
+ private _delayedHangup;
59
+ private _abortController;
59
60
  private readonly _onUnload;
60
61
  private readonly _audioOutput;
61
62
  private readonly _stats;
@@ -73,6 +74,10 @@ export default class Conversation extends EventEmitter {
73
74
  static current(): Conversation | null;
74
75
  static hangupAfterInit(): void;
75
76
  static id(): string | null;
77
+ get id(): string;
78
+ get externalId(): ExternalParticipantId | undefined;
79
+ get mediaSettings(): MediaSettings | undefined;
80
+ get isCallHeld(): boolean;
76
81
  static debugSessionId(): string | null;
77
82
  static getSyncedTime(): number;
78
83
  get debugSessionId(): string | null;
@@ -179,6 +184,7 @@ export default class Conversation extends EventEmitter {
179
184
  private _cleanupParticipants;
180
185
  private _cleanupParticipantAgnosticStreams;
181
186
  private _cleanupTransport;
187
+ private _cleanupTransportForHold;
182
188
  private _cleanupSpeakerDetector;
183
189
  private _cleanupSpecListener;
184
190
  private _cleanupSignaling;
@@ -206,7 +212,12 @@ export default class Conversation extends EventEmitter {
206
212
  */
207
213
  changePriorities(priorities: ParticipantPriority[]): Promise<void>;
208
214
  changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<void>;
209
- hold(hold: boolean): Promise<void>;
215
+ hold(hold: boolean, lastActiveMediaSettings?: MediaSettings): Promise<void>;
216
+ private _holdLocally;
217
+ private _resumeLocalMedia;
218
+ private _restoreStateAfterHold;
219
+ private _isWaitingForPromotion;
220
+ private _getWaitingForPromotionStatus;
210
221
  putHandsDown(): Promise<void>;
211
222
  requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
212
223
  requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
@@ -310,6 +321,7 @@ export default class Conversation extends EventEmitter {
310
321
  private _changeMultipleParticipantState;
311
322
  private _invokeRolesChangedCallbackIfNeeded;
312
323
  private _onSignalingNotification;
324
+ private _onSignalingTopologyChanged;
313
325
  private _onPromotionApproved;
314
326
  private _onSignalingReconnect;
315
327
  private _onSignalingFailed;
@@ -351,6 +363,7 @@ export default class Conversation extends EventEmitter {
351
363
  private _onPinParticipant;
352
364
  private _onOptionsChanged;
353
365
  private _onNetworkStatus;
366
+ private _emitHeldParticipantsStatus;
354
367
  private _onRemoteStreamSecond;
355
368
  /**
356
369
  * Коллбек, вызывающийся при получении/остановке стрима от AnimojiReceiver
@@ -371,6 +384,7 @@ export default class Conversation extends EventEmitter {
371
384
  private _onSpeakerChanged;
372
385
  private _onTransportStateChanged;
373
386
  private _onTransportLocalStateChanged;
387
+ private _areTransportParticipantsOnHold;
374
388
  private _onRemoteTrackAdded;
375
389
  private _onRemoteTrackRemoved;
376
390
  private _removeAudioTrack;
@@ -400,6 +414,7 @@ export default class Conversation extends EventEmitter {
400
414
  private _onFeedback;
401
415
  private _onDecorativeParticipantIdChanged;
402
416
  private _onVideoSuspendSuggest;
417
+ private _onParticipantHold;
403
418
  private _isMe;
404
419
  private _getMuteStatesForRoomId;
405
420
  private _getMuteStatesForCurrentRoom;
@@ -409,6 +424,8 @@ export default class Conversation extends EventEmitter {
409
424
  private _getParticipants;
410
425
  private _getParticipant;
411
426
  }
427
+ declare function _resetPendingInstance(): void;
428
+ export { _resetPendingInstance };
412
429
  export declare class UpdateDisplayLayoutError extends Error {
413
430
  readonly participantErrors: {
414
431
  externalId: ExternalParticipantId;
@@ -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
  }
@@ -27,6 +27,7 @@ export default class DirectTransport extends BaseTransport {
27
27
  private _iceRestartTimeout;
28
28
  private _reconnectionTimeout;
29
29
  private _reconnectionPrevented;
30
+ private _remoteHold;
30
31
  private _lastStat;
31
32
  private _fingerprint;
32
33
  private _neverConnected;
@@ -50,6 +51,8 @@ export default class DirectTransport extends BaseTransport {
50
51
  updateSettings(settings: ServerSettings): void;
51
52
  preventRestart(): void;
52
53
  allowRestart(): void;
54
+ setRemoteHold(hold: boolean): void;
55
+ private _recreatePeerConnection;
53
56
  setAnimojiTransport(receiver: AnimojiReceiver, sender: AnimojiSender): void;
54
57
  close(error?: Error): void;
55
58
  private _setState;
@@ -55,6 +55,8 @@ export declare class Transport extends EventEmitter {
55
55
  open(participantIds: ParticipantId[], peerId?: string | null, observer?: boolean, force?: boolean): void;
56
56
  close(participantId: ParticipantId): void;
57
57
  destroy(): void;
58
+ holdClose(): void;
59
+ setRemoteHold(hold: boolean): void;
58
60
  getTopology(): TransportTopology;
59
61
  isAllocated(participantId: ParticipantId): boolean;
60
62
  allocated(): string[];
@@ -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-beta.5",
3
+ "version": "2.8.11-beta.6",
4
4
  "author": "vk.com",
5
5
  "description": "Library for video calls based on the vk.com platform",
6
6
  "homepage": "https://vk.com",