@vkontakte/calls-sdk 2.8.2-dev.968ce3b.0 → 2.8.2-dev.9a2f8df.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.
Files changed (40) hide show
  1. package/CallsSDK.d.ts +71 -36
  2. package/abstract/BaseApi.d.ts +10 -8
  3. package/abstract/BaseSignaling.d.ts +7 -5
  4. package/calls-sdk.cjs.js +8 -8
  5. package/calls-sdk.esm.js +8 -8
  6. package/classes/AudioOutput.d.ts +8 -3
  7. package/classes/Conversation.d.ts +18 -3
  8. package/classes/MediaSource.d.ts +2 -2
  9. package/classes/ParticipantIdRegistry.d.ts +5 -0
  10. package/classes/ProducerCommandSerializationService.d.ts +2 -0
  11. package/classes/codec/IEncoder.d.ts +1 -1
  12. package/classes/codec/LibVPxEncoder.d.ts +1 -1
  13. package/classes/codec/Types.d.ts +1 -1
  14. package/classes/codec/WebCodecsEncoder.d.ts +1 -1
  15. package/classes/screenshare/PacketHistory.d.ts +1 -0
  16. package/classes/screenshare/ScreenCaptureSender.d.ts +2 -1
  17. package/classes/screenshare/ScreenCongestionControl.d.ts +6 -1
  18. package/classes/transport/ServerTransport.d.ts +2 -0
  19. package/classes/transport/Statistics.d.ts +19 -1
  20. package/classes/transport/Transport.d.ts +1 -0
  21. package/default/Api.d.ts +13 -13
  22. package/default/Signaling.d.ts +9 -8
  23. package/enums/SignalingCommandType.d.ts +6 -2
  24. package/enums/SignalingNotification.d.ts +2 -1
  25. package/package.json +3 -6
  26. package/static/AuthData.d.ts +6 -6
  27. package/static/External.d.ts +36 -6
  28. package/static/Params.d.ts +51 -25
  29. package/static/Utils.d.ts +2 -2
  30. package/types/Asr.d.ts +1 -1
  31. package/types/AudienceMode.d.ts +8 -0
  32. package/types/Conversation.d.ts +3 -0
  33. package/types/ExternalId.d.ts +13 -15
  34. package/types/MuteStates.d.ts +1 -1
  35. package/types/ParticipantLayout.d.ts +2 -2
  36. package/types/ParticipantStreamDescription.d.ts +0 -1
  37. package/types/RequestAsr.d.ts +3 -0
  38. package/types/Room.d.ts +3 -0
  39. package/types/Statistics.d.ts +1 -2
  40. package/types/Streams.d.ts +10 -0
@@ -1,14 +1,19 @@
1
+ type ParticipantAudioOutput = {
2
+ audioElement?: HTMLAudioElement;
3
+ audioTrack?: MediaStreamTrack;
4
+ };
1
5
  export default class AudioOutput {
2
- private _output;
6
+ protected _output: ParticipantAudioOutput | null;
3
7
  private _volume;
4
8
  private readonly _features;
5
9
  add(track: MediaStreamTrack): void;
6
10
  remove(track: MediaStreamTrack): void;
7
11
  get volume(): number;
8
12
  set volume(volume: number);
9
- private _initAudioElement;
10
- private _stopAudioElement;
13
+ protected _initAudioElement(): void;
14
+ protected _stopAudioElement(): void;
11
15
  destroy(): void;
12
16
  /** изменяем устройство для воспроизведения аудио */
13
17
  changeOutput(): Promise<void>;
14
18
  }
19
+ export {};
@@ -6,12 +6,12 @@ import CallType from '../enums/CallType';
6
6
  import ConversationFeature from '../enums/ConversationFeature';
7
7
  import ConversationOption from '../enums/ConversationOption';
8
8
  import MediaOption from '../enums/MediaOption';
9
- import RecordRole from '../enums/RecordRole';
10
9
  import UpdateDisplayLayoutErrorReason from '../enums/UpdateDisplayLayoutErrorReason';
11
10
  import UserRole from '../enums/UserRole';
12
11
  import UserType from '../enums/UserType';
13
12
  import { JSONObject } from '../static/Json';
14
13
  import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
14
+ import { AudienceModeHandsResponse } from '../types/AudienceMode';
15
15
  import { ConversationData } from '../types/Conversation';
16
16
  import { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
17
17
  import MediaModifiers from '../types/MediaModifiers';
@@ -34,6 +34,10 @@ export type ParticipantUpdateInfo = {
34
34
  sequenceNumber: number;
35
35
  fastScreenShare: boolean;
36
36
  };
37
+ export type ParticipantSuspendInfo = {
38
+ participantStreamDescription: ParticipantStreamDescription | null;
39
+ suspend: boolean;
40
+ };
37
41
  export default class Conversation extends EventEmitter {
38
42
  private readonly _api;
39
43
  private readonly _signaling;
@@ -83,6 +87,9 @@ export default class Conversation extends EventEmitter {
83
87
  private _onJoinPart2;
84
88
  onPush(conversationId: string, type?: UserType, peerId?: number): Promise<void>;
85
89
  private _isInWaitingHall;
90
+ private _isRestricted;
91
+ private _isAudienceMode;
92
+ private _isAudienceModeListener;
86
93
  private _acceptConcurrent;
87
94
  accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
88
95
  decline(): Promise<void>;
@@ -211,6 +218,7 @@ export default class Conversation extends EventEmitter {
211
218
  private _sendUpdateDisplayLayout;
212
219
  private _cleanupCooldownQueue;
213
220
  private _onParticipantSourcesUpdate;
221
+ private _onParticipantSourcesSuspend;
214
222
  private _onParticipantPromoted;
215
223
  private _onChatRoomUpdated;
216
224
  private _onSharedMovieUpdate;
@@ -223,10 +231,11 @@ export default class Conversation extends EventEmitter {
223
231
  private _onFeaturesPerRoleChanged;
224
232
  private _waitForStreamIfNeeded;
225
233
  private _matchStreamDescription;
234
+ private _handleParticipantSuspend;
226
235
  private _getWaitingTime;
227
236
  private _isCallAdmin;
228
237
  private _checkAdminRole;
229
- grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<void>;
238
+ grantRoles(participantId: ParticipantId, roles: UserRole[], revoke: boolean): Promise<void>;
230
239
  startAsr(params: IAsrStartParams): Promise<void>;
231
240
  stopAsr(params?: IAsrStopParams): Promise<void>;
232
241
  requestAsr(request: boolean): Promise<void>;
@@ -242,7 +251,11 @@ export default class Conversation extends EventEmitter {
242
251
  * @hidden
243
252
  */
244
253
  getWaitingHall(pageMarker: string | null, count?: number, backward?: boolean): Promise<WaitingHallResponse>;
254
+ private _resolveExternalIds;
255
+ getAudienceModeHands(): Promise<AudienceModeHandsResponse>;
245
256
  promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<void>;
257
+ requestPromotion(demote?: boolean): Promise<void>;
258
+ acceptPromotion(reject?: boolean): Promise<void>;
246
259
  chatMessage(message: string, participantId?: CompositeUserId | null): Promise<void>;
247
260
  chatHistory(count: number): Promise<void>;
248
261
  customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
@@ -260,7 +273,8 @@ export default class Conversation extends EventEmitter {
260
273
  removeRooms(roomIds: number[]): Promise<void>;
261
274
  startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<undefined>;
262
275
  stopStream(roomId?: number | null): Promise<undefined>;
263
- recordSetRole(participantId: ParticipantId, role: RecordRole | null, roomId?: number | null): Promise<void>;
276
+ publishStream(roomId?: number | null): Promise<undefined>;
277
+ recordSetConf(king?: ParticipantId, pawns?: ParticipantId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
264
278
  getStreamInfo(): Promise<{
265
279
  movieId: any;
266
280
  preview: any;
@@ -279,6 +293,7 @@ export default class Conversation extends EventEmitter {
279
293
  private _changeRemoteParticipantState;
280
294
  private _invokeRolesChangedCallbackIfNeeded;
281
295
  private _onSignalingNotification;
296
+ private _onPromotionApproved;
282
297
  private _onSignalingReconnect;
283
298
  private _onSignalingFailed;
284
299
  private _onAcceptedCall;
@@ -20,7 +20,7 @@ export declare const enum MediaTrackKind {
20
20
  }
21
21
  export declare class MediaSource extends EventEmitter {
22
22
  /** Стрим с камеры и микрофона пользователя */
23
- private _stream;
23
+ protected _stream: MediaStream | null;
24
24
  private _screenTrack;
25
25
  private _audioShareTrack;
26
26
  /** Трек для отправки в медиа-канал. Может отличаться при скриншаринге в дата-канал */
@@ -68,7 +68,7 @@ export declare class MediaSource extends EventEmitter {
68
68
  private disableAudioShare;
69
69
  private stopAudioShareTrack;
70
70
  private getSilentAudioShareTrack;
71
- private _replaceLocalTrack;
71
+ protected _replaceLocalTrack(newTrack: MediaStreamTrack, sendTrack?: MediaStreamTrack): Promise<void>;
72
72
  private _setEffect;
73
73
  private _stopEffect;
74
74
  destroy(): void;
@@ -1,5 +1,9 @@
1
1
  import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
2
2
  import SignalingMessage from '../types/SignalingMessage';
3
+ export type IParticipantSuspendInfoParse = [
4
+ number,
5
+ boolean
6
+ ];
3
7
  export declare class ParticipantIdRegistry {
4
8
  private streamDescriptionByCompactId;
5
9
  private compactIdByStreamDescription;
@@ -7,4 +11,5 @@ export declare class ParticipantIdRegistry {
7
11
  getCompactId(streamDescription: string): number | undefined;
8
12
  handleMessage(data: ArrayBuffer): SignalingMessage | null;
9
13
  private _createParticipantSourcesUpdateNotification;
14
+ private _createParticipantSourcesSuspendNotification;
10
15
  }
@@ -1,4 +1,5 @@
1
1
  import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
2
+ import { RequestAsr } from '../types/RequestAsr';
2
3
  import SignalingMessage from '../types/SignalingMessage';
3
4
  import { PerfStatReport } from '../types/PerfStatReporter';
4
5
  import { SharingStatReport } from './screenshare/SharingStatReport';
@@ -13,6 +14,7 @@ export declare class ProducerCommandSerializationService {
13
14
  private writeStreamDesc;
14
15
  serializePerfStatReport(sequenceNumber: number, report: PerfStatReport): ArrayBuffer;
15
16
  serializeSharingStatReport(sequenceNumber: number, report: SharingStatReport): ArrayBuffer;
17
+ serializeRequestAsr(sequenceNumber: number, params: RequestAsr): ArrayBuffer;
16
18
  deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
17
19
  private deserializeUpdateDisplayLayoutResponse;
18
20
  private deserializeReportPerfStatResponse;
@@ -5,7 +5,7 @@ export default interface IEncoder {
5
5
  requestFrame(keyFrame: boolean): void;
6
6
  isVP9(): boolean;
7
7
  destroy(): void;
8
- setBitrate(bitrate: number, useCbr: boolean): void;
8
+ setBitrate(bitrate: number, useCbr: boolean, fps: number): void;
9
9
  }
10
10
  export interface FrameMessage {
11
11
  type: MessageType;
@@ -29,7 +29,7 @@ export default class LibVPxEncoder extends WorkerBase implements IEncoder {
29
29
  private _requestFrameVideo;
30
30
  private _requestFrameBitmap;
31
31
  requestFrame(keyFrame?: boolean): void;
32
- setBitrate(bitrate: number, useCbr?: boolean): void;
32
+ setBitrate(bitrate: number, useCbr: boolean, fps: number): void;
33
33
  isVP9(): boolean;
34
34
  destroy(): void;
35
35
  static isBrowserSupported(): boolean;
@@ -26,4 +26,4 @@ export interface EncodedVideoFrameChunk {
26
26
  isKey: boolean;
27
27
  }
28
28
  export type OnFrameCallback = (chunk: EncodedVideoFrame | null, error?: string) => void;
29
- export type OnCongestionCallback = (bitrate: number, useCbr: boolean) => void;
29
+ export type OnCongestionCallback = (bitrate: number, useCbr: boolean, fps: number) => void;
@@ -12,7 +12,7 @@ export default class WebCodecsEncoder extends WorkerBase implements IEncoder {
12
12
  constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, useCbr: boolean, frameRate: number);
13
13
  init(): Promise<void>;
14
14
  requestFrame(keyFrame?: boolean): void;
15
- setBitrate(bitrate: number, useCbr: boolean): void;
15
+ setBitrate(bitrate: number, useCbr: boolean, fps: number): void;
16
16
  isVP9(): boolean;
17
17
  destroy(): void;
18
18
  static isBrowserSupported(): boolean;
@@ -26,5 +26,6 @@ export default class PacketHistory {
26
26
  getServerBitrateK(windowMs: number): number;
27
27
  getCurrentDelay(): number;
28
28
  getMaxBandwidth(): number;
29
+ clear(): void;
29
30
  }
30
31
  export {};
@@ -12,6 +12,8 @@ export default class ScreenCaptureSender {
12
12
  private _width;
13
13
  private _height;
14
14
  private _feedback;
15
+ private _lastSentFrameSeq;
16
+ private _lastDeliveredFrameSeq;
15
17
  private _lastSharingStat;
16
18
  private readonly _congestionControlEnabled;
17
19
  private readonly _queue;
@@ -34,6 +36,5 @@ export default class ScreenCaptureSender {
34
36
  private _onCongestionCallback;
35
37
  private _onResize;
36
38
  private _calcMinMaxBitrate;
37
- private _checkCcFeedback;
38
39
  private _sendSharingStat;
39
40
  }
@@ -6,6 +6,7 @@ export default class ScreenCongestionControl {
6
6
  private readonly _fastSharing;
7
7
  private readonly _trendDelayThreshold;
8
8
  private readonly _highDelayThreshold;
9
+ private readonly _targetFps;
9
10
  private _minBitrate;
10
11
  private _maxBitrate;
11
12
  private _targetBitrate;
@@ -20,10 +21,14 @@ export default class ScreenCongestionControl {
20
21
  private _minDelay;
21
22
  private _maxDelay;
22
23
  private _largeDelayDuration;
23
- constructor(onCongestion: OnCongestionCallback, minBitrate: number, maxBitrate: number, ccEnabled: boolean, fastSharing: boolean, delayThreshold: number);
24
+ private _lastFpsCalcMs;
25
+ private _frames;
26
+ private _fps;
27
+ constructor(onCongestion: OnCongestionCallback, minBitrate: number, maxBitrate: number, ccEnabled: boolean, fastSharing: boolean, delayThreshold: number, targetFps: number);
24
28
  checkDelay(frameNum: number, delay: number, bitrateK: number): void;
25
29
  private _setBitrate;
26
30
  private _calcDelay;
27
31
  reconfigure(minBitrate: number, maxBitrate: number): void;
28
32
  getStat(): SharingStatReport | null;
33
+ private _calcFps;
29
34
  }
@@ -20,6 +20,7 @@ export default class ServerTransport extends BaseTransport {
20
20
  private _settingsInterval;
21
21
  private _statBytes;
22
22
  private _ssrcMap;
23
+ private _ssrcMapUpdated;
23
24
  private _perfStatReporter;
24
25
  private _producerOfferIsProcessing;
25
26
  private _producerNextOffer;
@@ -43,6 +44,7 @@ export default class ServerTransport extends BaseTransport {
43
44
  allowRestart(): void;
44
45
  updateSettings(settings: ServerSettings): void;
45
46
  setAnimojiTransport(receiver: AnimojiReceiver, sender: AnimojiSender): void;
47
+ private _createPerfStatsReporter;
46
48
  private _closeConnection;
47
49
  private static _closeDataChannel;
48
50
  private _createDataChannel;
@@ -1,5 +1,23 @@
1
1
  import { ParticipantId } from '../../types/Participant';
2
- import { StatItem } from '../../types/Statistics';
2
+ import { StatItem, StatRtp, StatTransport } from '../../types/Statistics';
3
+ export declare const NO_STAT_REQUEST_DELAY = 1000;
4
+ export declare function distinctById(items: RTCStats[]): RTCStats[];
5
+ export declare function rtcStatsToArray(stats: RTCStatsReport[]): RTCStats[];
6
+ /**
7
+ * Extracts transport statistics from the gives stats
8
+ * @hidden
9
+ */
10
+ export declare function extractTransport(stats: RTCStats[]): StatTransport;
11
+ /**
12
+ * Extracts media statistics from the given stats
13
+ * @hidden
14
+ */
15
+ export declare function extractRtps(stats: RTCStats[], ssrcMap: Record<string, string>): StatRtp[];
16
+ /**
17
+ * Computes delta (the difference) between two stat reports.
18
+ * @hidden
19
+ */
20
+ export declare function delta(current: StatItem, previous: StatItem): StatItem;
3
21
  export declare function collectStats(pc: RTCPeerConnection, previous: StatItem | null, ssrcMap?: Record<string, string>): Promise<StatItem>;
4
22
  export declare function setMark(name: string): void;
5
23
  export declare function clearMark(name: string): void;
@@ -89,6 +89,7 @@ export declare class Transport extends EventEmitter {
89
89
  private _onServerRemoteTrackAdded;
90
90
  private _onServerRemoteTrackRemoved;
91
91
  private _onAsrTranscription;
92
+ private _onSourceChanged;
92
93
  private _onAnimojiStream;
93
94
  /** Обработчик, досылающий MediaSourceEvent.SOURCE_CHANGED событие до аллокации транспортов */
94
95
  private _onAnimojiStatus;
package/default/Api.d.ts CHANGED
@@ -2,30 +2,28 @@ import BaseApi, { LogItem } from '../abstract/BaseApi';
2
2
  import CallType from '../enums/CallType';
3
3
  import ConversationParams from '../types/ConversationParams';
4
4
  import ConversationResponse from '../types/ConversationResponse';
5
- import { ExternalId, ExternalUserId } from '../types/ExternalId';
6
- import { CompositeUserId, OkUserId } from '../types/Participant';
5
+ import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
6
+ import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
7
7
  export default class Api extends BaseApi {
8
8
  private _userId;
9
9
  private _uuid;
10
10
  private _externalUidsCache;
11
- private _extrnalUidsBatchPromise?;
12
- private _extrnalUidsBatch;
13
- private _extrnalUidsBatchTimeout;
14
11
  private _callUnsafe;
15
12
  private _call;
16
- userId(compositeUserId: CompositeUserId): Promise<ExternalId>;
13
+ userId(compositeUserId: ParticipantId): Promise<ExternalParticipantId>;
17
14
  prepareUserIds(ids: OkUserId[]): Promise<void>;
18
- private _prepareUserIdsByOkIdsBatched;
19
15
  authorize(): Promise<void>;
20
16
  log(items: LogItem[]): void;
21
17
  init(): void;
22
18
  joinConversation(conversationId: string, isVideo?: boolean, chatId?: string): Promise<ConversationResponse>;
23
- createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie }?: {
19
+ createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie, audienceMode, }?: {
24
20
  onlyAdminCanShareMovie?: boolean;
25
- }): Promise<ConversationResponse>;
21
+ audienceMode?: boolean;
22
+ }, speakerIds?: OkUserId[]): Promise<ConversationResponse>;
26
23
  startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie }?: {
27
24
  onlyAdminCanShareMovie?: boolean;
28
25
  }): Promise<ConversationResponse>;
26
+ protected _ensureUuid(): void;
29
27
  private _preareStartConversationData;
30
28
  private _startConversation;
31
29
  createJoinLink(conversationId: string): Promise<{
@@ -38,16 +36,18 @@ export default class Api extends BaseApi {
38
36
  joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
39
37
  /**
40
38
  * NB: Не сохраняет порядок возвращаемых ID
39
+ * Этот метод принимает именно ExternalId, т.к. для OkUserId не принципиально наличие deviceIdx
41
40
  * @hidden
42
41
  */
43
- getOkIdsByExternalIds(externalIds: (string | ExternalId)[]): Promise<OkUserId[]>;
42
+ getOkIdsByExternalIds(externalIds: ExternalId[]): Promise<OkUserId[]>;
43
+ getParticipantIdsByExternalIds(externalIds: ExternalId[]): Promise<Map<ExternalId, ParticipantId>>;
44
44
  /**
45
45
  * NB: Не сохраняет порядок возвращаемых ID
46
46
  * @hidden
47
47
  */
48
- getExternalIdsByOkIds(uids: OkUserId[]): Promise<ExternalId[]>;
49
- getCachedOkIdByExternalId(externalId: ExternalId): CompositeUserId | null;
50
- cacheExternalId(participantId: CompositeUserId, externalId: ExternalId): void;
48
+ getExternalIdsByOkIds(uids: OkUserId[]): Promise<ExternalParticipantId[]>;
49
+ getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
50
+ cacheExternalId(participantId: CompositeUserId, externalId: ExternalParticipantId): void;
51
51
  getConversationParams(conversationId?: string): Promise<ConversationParams>;
52
52
  getUserId(): OkUserId | null;
53
53
  setUserId(userId: OkUserId): void;
@@ -1,13 +1,10 @@
1
1
  import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
2
2
  import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
3
3
  import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
4
- import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
5
- import { PerfStatReport } from '../types/PerfStatReporter';
6
4
  import { TransportTopology } from '../classes/transport/Transport';
7
5
  import ConversationFeature from '../enums/ConversationFeature';
8
6
  import ConversationOption from '../enums/ConversationOption';
9
7
  import MediaOption from '../enums/MediaOption';
10
- import RecordRole from '../enums/RecordRole';
11
8
  import SignalingCommandType from '../enums/SignalingCommandType';
12
9
  import SignalingConnectionType from '../enums/SignalingConnectionType';
13
10
  import UserRole from '../enums/UserRole';
@@ -20,8 +17,10 @@ import MuteStates from '../types/MuteStates';
20
17
  import { CompositeUserId, ParticipantId } from '../types/Participant';
21
18
  import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
22
19
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
20
+ import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
21
+ import { PerfStatReport } from '../types/PerfStatReporter';
23
22
  import SignalingMessage from '../types/SignalingMessage';
24
- import { IStartStreamData, IStopStreamData } from '../types/Streams';
23
+ import { IRecordConfData, IStartStreamData, IStopStreamData, IPublishStreamData } from '../types/Streams';
25
24
  import { WaitingParticipantId } from '../types/WaitingHall';
26
25
  export default class Signaling extends BaseSignaling {
27
26
  private socket;
@@ -118,7 +117,8 @@ export default class Signaling extends BaseSignaling {
118
117
  removeRooms(roomIds: number[]): Promise<SignalingMessage>;
119
118
  startStream(data: IStartStreamData): Promise<SignalingMessage>;
120
119
  stopStream(data?: IStopStreamData): Promise<SignalingMessage>;
121
- recordSetRole(participantId: ParticipantId, role: RecordRole | null, roomId?: number | null): Promise<SignalingMessage>;
120
+ publishStream(data?: IPublishStreamData): Promise<SignalingMessage>;
121
+ recordSetConf(conf?: IRecordConfData): Promise<SignalingMessage>;
122
122
  getRecordStatus(): Promise<SignalingMessage>;
123
123
  switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
124
124
  requestRealloc(): Promise<SignalingMessage>;
@@ -127,7 +127,7 @@ export default class Signaling extends BaseSignaling {
127
127
  chatMessage(message: string, participantId?: CompositeUserId | null): Promise<SignalingMessage>;
128
128
  chatHistory(count: number): Promise<SignalingMessage>;
129
129
  customData(data: JSONObject, participantId: ParticipantId | null): Promise<SignalingMessage>;
130
- grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
130
+ grantRoles(participantId: ParticipantId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
131
131
  muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[], roomId?: number | null): Promise<SignalingMessage>;
132
132
  enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<SignalingMessage>;
133
133
  pinParticipant(participantId: ParticipantId, unpin: boolean, roomId: number | null): Promise<SignalingMessage>;
@@ -137,7 +137,10 @@ export default class Signaling extends BaseSignaling {
137
137
  }): Promise<SignalingMessage>;
138
138
  getWaitingHall(fromId?: WaitingParticipantId | null, count?: number, backward?: boolean): Promise<SignalingMessage>;
139
139
  promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
140
+ requestPromotion(demote?: boolean): Promise<SignalingMessage>;
141
+ acceptPromotion(reject?: boolean): Promise<SignalingMessage>;
140
142
  feedback(key: string): Promise<SignalingMessage>;
143
+ getHandQueue(): Promise<SignalingMessage>;
141
144
  /**
142
145
  * Close a connection with a signaling server
143
146
  */
@@ -154,7 +157,6 @@ export default class Signaling extends BaseSignaling {
154
157
  startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
155
158
  stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
156
159
  requestAsr(request: boolean): Promise<SignalingMessage>;
157
- setAsrDataChannel(dataChannel: RTCDataChannel): void;
158
160
  protected _connect(connectionType: SignalingConnectionType): void;
159
161
  protected _disconnect(code?: number): void;
160
162
  private _onOpen;
@@ -168,7 +170,6 @@ export default class Signaling extends BaseSignaling {
168
170
  protected _closeSocket(error?: Error | null): void;
169
171
  protected _reconnect(): void;
170
172
  private _handleCommandResponse;
171
- private _serializeAsrCommand;
172
173
  private _handleCommandsQueue;
173
174
  private _serializeBinary;
174
175
  private _serializeJson;
@@ -15,7 +15,8 @@ declare enum SignalingCommandType {
15
15
  REPORT_SHARING_STAT = "report-sharing-stat",
16
16
  RECORD_START = "record-start",
17
17
  RECORD_STOP = "record-stop",
18
- RECORD_SET_ROLE = "record-set-role",
18
+ RECORD_PUBLISH = "record-publish",
19
+ RECORD_SET_CONF = "record-set-conf",
19
20
  RECORD_GET_STATUS = "record-get-status",
20
21
  SWITCH_MICRO = "switch-micro",
21
22
  SWITCH_TOPOLOGY = "switch-topology",
@@ -45,6 +46,9 @@ declare enum SignalingCommandType {
45
46
  FEEDBACK = "feedback",
46
47
  ASR_START = "asr-start",
47
48
  ASR_STOP = "asr-stop",
48
- REQUEST_ASR = "request-asr"
49
+ REQUEST_ASR = "request-asr",
50
+ REQUEST_PROMOTION = "request-promotion",
51
+ ACCEPT_PROMOTION = "accept-promotion",
52
+ GET_HAND_QUEUE = "get-hand-queue"
49
53
  }
50
54
  export default SignalingCommandType;
@@ -46,6 +46,7 @@ declare enum SignalingNotification {
46
46
  FEATURES_PER_ROLE_CHANGED = "features-per-role-changed",
47
47
  PARTICIPANT_ANIMOJI_CHANGED = "participant-animoji-changed",
48
48
  ASR_STARTED = "asr-started",
49
- ASR_STOPPED = "asr-stopped"
49
+ ASR_STOPPED = "asr-stopped",
50
+ PARTICIPANT_SOURCES_SUSPEND = "participant-sources-suspend"
50
51
  }
51
52
  export default SignalingNotification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.2-dev.968ce3b.0",
3
+ "version": "2.8.2-dev.9a2f8df.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,15 +14,12 @@
14
14
  "**/*.d.ts"
15
15
  ],
16
16
  "dependencies": {
17
- "@vkontakte/calls-video-effects": "2.0.1-beta.0",
18
- "@vkontakte/calls-vmoji": "1.0.7-beta.3",
17
+ "@vkontakte/calls-video-effects": "2.0.1-beta.5",
18
+ "@vkontakte/calls-vmoji": "1.0.8-beta.6",
19
19
  "@vkontakte/libvpx": "2.0.9",
20
20
  "bit-buffer": "0.2.5",
21
21
  "messagepack": "1.1.12",
22
22
  "simple-ebml-builder": "0.2.2",
23
23
  "webrtc-adapter": "7.7.0"
24
- },
25
- "prettier": {
26
- "editorconfig": true
27
24
  }
28
25
  }
@@ -2,11 +2,11 @@ export default abstract class AuthData {
2
2
  private static _sessionKey;
3
3
  private static _sessionSecretKey;
4
4
  private static _accessToken;
5
- static get sessionKey(): string;
6
- static set sessionKey(value: string);
7
- static get sessionSecretKey(): string;
8
- static set sessionSecretKey(value: string);
9
- static get accessToken(): string;
10
- static set accessToken(value: string);
5
+ static get sessionKey(): string | undefined;
6
+ static set sessionKey(value: string | undefined);
7
+ static get sessionSecretKey(): string | undefined;
8
+ static set sessionSecretKey(value: string | undefined);
9
+ static get accessToken(): string | undefined;
10
+ static set accessToken(value: string | undefined);
11
11
  static isEmpty(): boolean;
12
12
  }
@@ -126,6 +126,20 @@ declare namespace External {
126
126
  * @param stream
127
127
  */
128
128
  function onRemoteVmojiStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
129
+ /**
130
+ * Cтрим собеседника приостановлен/возобновлен.
131
+ *
132
+ * @param userId
133
+ * @param suspended true - стрим был приостановлен, false - стрим был запущен
134
+ */
135
+ function onRemoteStreamSuspended(userId: ExternalParticipantId, suspended: boolean): void;
136
+ /**
137
+ * Стрим с экрана собеседника приостановлен/возобновлен.
138
+ *
139
+ * @param userId
140
+ * @param suspended true - стрим был приостановлен, false - стрим был запущен
141
+ */
142
+ function onRemoteScreenStreamSuspended(userId: ExternalParticipantId, suspended: boolean): void;
129
143
  /**
130
144
  * Начат звонок
131
145
  *
@@ -135,7 +149,7 @@ declare namespace External {
135
149
  * @param participants Список участников звонка
136
150
  * @param rooms Список сессионных залов в звонке
137
151
  */
138
- function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[], rooms?: Rooms): void;
152
+ function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms): void;
139
153
  /**
140
154
  * Постраничные данные про участников при начале звонка
141
155
  * @param chunk
@@ -177,15 +191,17 @@ declare namespace External {
177
191
  *
178
192
  * @param userId
179
193
  * @param sharedMovieInfo
194
+ * @param roomId
180
195
  */
181
- function onLocalSharedMovieInfo(userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo): void;
196
+ function onLocalSharedMovieInfo(userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo, roomId?: IRoomId): void;
182
197
  /**
183
198
  * Полученны данные по собственным остановленным стримам (лайв/мувик)
184
199
  *
185
200
  * @param userId
186
201
  * @param sharedMovieStoppedInfo
202
+ * @param roomId
187
203
  */
188
- function onLocalSharedMovieStoppedInfo(userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo): void;
204
+ function onLocalSharedMovieStoppedInfo(userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo, roomId?: IRoomId): void;
189
205
  /**
190
206
  * Добавили участника
191
207
  *
@@ -414,13 +430,21 @@ declare namespace External {
414
430
  */
415
431
  function onAutoplayError(): void;
416
432
  /**
417
- * Изменилось состояние зала ожидания
433
+ * Изменилось состояние зала ожидания/зала в режиме Audience
418
434
  *
419
435
  * @param eventType
420
- * @param totalCount Количество ожидающих
436
+ * @param totalCount Количество ожидающих/слушателей
421
437
  * @param firstParticipants Первые несколько ожидающих в зале
438
+ * @param addedParticipantIds Некоторое количество участников, добавленных в зал
439
+ * @param removedParticipantIds Некоторое количество участников, убранных из зала
440
+ */
441
+ function onChatRoomUpdated(eventType: ChatRoomEventType, totalCount: number, firstParticipants: ExternalId[], addedParticipantIds: ExternalId[], removedParticipantIds: ExternalId[]): void;
442
+ /**
443
+ * Участник повышен/разжалован в зале ожидания/зале в режиме Audience
444
+ *
445
+ * @param demoted участник разжалован
422
446
  */
423
- function onChatRoomUpdated(eventType: ChatRoomEventType, totalCount: number, firstParticipants: ExternalId[]): void;
447
+ function onPromoted(demoted: boolean): void;
424
448
  /**
425
449
  * Получен микшированный аудио стрим.
426
450
  *
@@ -494,5 +518,11 @@ declare namespace External {
494
518
  */
495
519
  function onAsrStopped(roomId: number | null): void;
496
520
  function onAsrTranscription(id: ExternalParticipantId, text: string, timestamp: number, duration: number): void;
521
+ /**
522
+ * Одобрено повышение пользователя в зеле ожидания/зале в режиме Audience
523
+ *
524
+ * @param adminParticipantId админ, одобривший повышение
525
+ */
526
+ function onPromotionApproved(adminParticipantId: ExternalParticipantId): void;
497
527
  }
498
528
  export default External;