@vkontakte/calls-sdk 2.8.11-dev.48925708.0 → 2.8.11-dev.4fa379f4.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,22 @@
1
+ import Conversation from './Conversation';
2
+ export interface HoldableConversation extends Conversation {
3
+ id: string;
4
+ hold(hold: boolean): Promise<void>;
5
+ }
6
+ export declare class CallRegistry {
7
+ private _conversations;
8
+ private _activeId;
9
+ private _mutex;
10
+ add(conversation: HoldableConversation): void;
11
+ remove(id: string | null): void;
12
+ get(id: string): HoldableConversation | undefined;
13
+ getActive(): HoldableConversation | null;
14
+ getActiveId(): string | null;
15
+ has(id: string): boolean;
16
+ getAll(): HoldableConversation[];
17
+ get callsLength(): number;
18
+ setActive(id: string): Promise<void>;
19
+ clear(): void;
20
+ }
21
+ declare const callRegistry: CallRegistry;
22
+ export { callRegistry };
@@ -16,11 +16,11 @@ 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';
23
- import { DisplayLayoutRequest, ParticipantLayout } from '../types/ParticipantLayout';
23
+ import { ParticipantLayout } from '../types/ParticipantLayout';
24
24
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
25
25
  import ParticipantPriority from '../types/ParticipantPriority';
26
26
  import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
@@ -32,7 +32,6 @@ export default class Conversation extends EventEmitter {
32
32
  private readonly _api;
33
33
  private readonly _signaling;
34
34
  private readonly _signalingActor;
35
- private readonly _displayLayoutRequester;
36
35
  private _mediaSource;
37
36
  private _conversation;
38
37
  private _myLastRequestedLayouts;
@@ -51,10 +50,8 @@ export default class Conversation extends EventEmitter {
51
50
  private _isRealTimeAsrRequested;
52
51
  private _serverSettings;
53
52
  private _serverTimeOffset;
54
- private static _current;
55
- private static _activationMutex;
56
- private static _delayedHangup;
57
- private static _abortController;
53
+ private _delayedHangup;
54
+ private _abortController;
58
55
  private readonly _onUnload;
59
56
  private readonly _audioOutput;
60
57
  private _lastStalled;
@@ -71,6 +68,10 @@ export default class Conversation extends EventEmitter {
71
68
  static current(): Conversation | null;
72
69
  static hangupAfterInit(): void;
73
70
  static id(): string | null;
71
+ get id(): string;
72
+ get externalId(): ExternalParticipantId | undefined;
73
+ get mediaSettings(): MediaSettings | undefined;
74
+ get isCallHeld(): boolean;
74
75
  static getSyncedTime(): number;
75
76
  onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
76
77
  onJoin(joinArgs: {
@@ -207,7 +208,6 @@ export default class Conversation extends EventEmitter {
207
208
  requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
208
209
  requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
209
210
  updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
210
- requestDisplayLayout(requests: DisplayLayoutRequest[]): Promise<void>;
211
211
  feedback(key: string): Promise<SignalingMessage>;
212
212
  userFeedbackStats(userResponse: number, reason?: string, groupCallUsersCount?: number): void;
213
213
  sendClientEvent(eventType: string, eventData?: Record<string, string | number | boolean>, immediately?: boolean): void;
@@ -397,6 +397,7 @@ export default class Conversation extends EventEmitter {
397
397
  private _onFeedback;
398
398
  private _onDecorativeParticipantIdChanged;
399
399
  private _onVideoSuspendSuggest;
400
+ private _onParticipantHold;
400
401
  private _isMe;
401
402
  private _getMuteStatesForRoomId;
402
403
  private _getMuteStatesForCurrentRoom;
@@ -406,6 +407,8 @@ export default class Conversation extends EventEmitter {
406
407
  private _getParticipants;
407
408
  private _getParticipant;
408
409
  }
410
+ declare function _resetPendingInstance(): void;
411
+ export { _resetPendingInstance };
409
412
  export declare class UpdateDisplayLayoutError extends Error {
410
413
  readonly participantErrors: {
411
414
  externalId: ExternalParticipantId;
@@ -45,6 +45,7 @@ export declare class MediaSource extends EventEmitter {
45
45
  /** Трек аудио эффектов. Не изменяется на протяжении всего времени */
46
46
  private _audioEffectsTrack;
47
47
  private _mediaSettings;
48
+ private _lastMediaSettings;
48
49
  private _videoStatusOnScreenCapturingEnabled;
49
50
  private _effect;
50
51
  private _audioEffectParams;
@@ -63,7 +64,11 @@ export declare class MediaSource extends EventEmitter {
63
64
  getSendAudioTrack(): MediaStreamTrack | null;
64
65
  get isAnimojiRequested(): boolean;
65
66
  addTrackToPeerConnection(pc: RTCPeerConnection, observer: boolean, noDataChannel: boolean): void;
67
+ /**
68
+ * @deprecated Используйте гетер mediaSettings
69
+ */
66
70
  getMediaSettings(): MediaSettings;
71
+ get mediaSettings(): MediaSettings;
67
72
  changeDevice(kind: MediaDeviceKind): Promise<void>;
68
73
  /**
69
74
  * Установка кастомного стрима для видео, например внешний шаринг экрана
@@ -91,6 +96,8 @@ export declare class MediaSource extends EventEmitter {
91
96
  private _setEffect;
92
97
  private _stopEffect;
93
98
  destroy(): void;
99
+ stopLocalMedia(): Promise<void>;
100
+ resumeLocalMedia(): Promise<void>;
94
101
  toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
95
102
  disableScreenCapturing(): Promise<void>;
96
103
  private videoTrackMuteHandler;
@@ -3,7 +3,12 @@ export declare class SignalingActor {
3
3
  private processor;
4
4
  private queue;
5
5
  private isProcessing;
6
+ private isHeld;
7
+ private isDestroyed;
6
8
  constructor(processor: (message: SignalingMessage) => Promise<unknown> | unknown);
7
9
  add(message: SignalingMessage): void;
10
+ hold(): void;
11
+ unhold(): void;
12
+ destroy(): void;
8
13
  private processQueue;
9
14
  }
@@ -59,6 +59,8 @@ export declare class Transport extends EventEmitter {
59
59
  close(participantId: ParticipantId): void;
60
60
  destroy(): void;
61
61
  getTopology(): TransportTopology;
62
+ preventRestart(): void;
63
+ allowRestart(): void;
62
64
  isAllocated(participantId: ParticipantId): boolean;
63
65
  allocated(): string[];
64
66
  opened(): 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-dev.48925708.0",
3
+ "version": "2.8.11-dev.4fa379f4.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;