@vkontakte/calls-sdk 2.8.5-dev.086cc589.0 → 2.8.5-dev.0c1f6988.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 (42) hide show
  1. package/CallsSDK.d.ts +23 -4
  2. package/abstract/BaseApi.d.ts +1 -0
  3. package/abstract/BaseSignaling.d.ts +10 -1
  4. package/calls-sdk.cjs.js +8 -8
  5. package/calls-sdk.esm.js +8 -8
  6. package/classes/AudioFix.d.ts +4 -0
  7. package/classes/AudioOutput.d.ts +3 -0
  8. package/classes/Conversation.d.ts +5 -15
  9. package/classes/MediaSource.d.ts +26 -5
  10. package/classes/ProducerCommandSerializationService.d.ts +2 -0
  11. package/classes/VideoEffectsFpsLimiter.d.ts +23 -0
  12. package/classes/codec/IDecoder.d.ts +1 -1
  13. package/classes/codec/LibVPxDecoder.d.ts +1 -1
  14. package/classes/codec/LibVPxEncoder.d.ts +0 -3
  15. package/classes/codec/WebCodecsDecoder.d.ts +1 -1
  16. package/classes/stat/StatFirstMediaReceived.d.ts +6 -5
  17. package/classes/transport/ServerTransport.d.ts +5 -0
  18. package/classes/transport/Transport.d.ts +1 -0
  19. package/default/Api.d.ts +1 -0
  20. package/default/Signaling.d.ts +3 -1
  21. package/enums/FatalError.d.ts +2 -1
  22. package/enums/SignalingCommandType.d.ts +2 -1
  23. package/package.json +4 -3
  24. package/static/ApiTransport.d.ts +1 -0
  25. package/static/ConversationDebugLogger.d.ts +13 -0
  26. package/static/External.d.ts +2 -1
  27. package/static/Params.d.ts +51 -2
  28. package/static/SimulcastInfo.d.ts +13 -0
  29. package/static/Utils.d.ts +4 -3
  30. package/static/WebRTCUtils.d.ts +5 -3
  31. package/types/ChangeSimulcast.d.ts +6 -0
  32. package/types/Conversation.d.ts +2 -14
  33. package/types/GetLogUploadUrlParams.d.ts +6 -0
  34. package/types/GetLogUploadUrlResponse.d.ts +3 -0
  35. package/types/Params.d.ts +1 -1
  36. package/types/SimulcastInfo.d.ts +10 -0
  37. package/types/Statistics.d.ts +11 -4
  38. package/types/VideoSettings.d.ts +12 -0
  39. package/utils/Conversation.d.ts +4 -0
  40. package/utils/DebugStorage.d.ts +6 -0
  41. package/utils/Media.d.ts +1 -2
  42. package/utils/NavigatorPermissions.d.ts +13 -0
@@ -9,8 +9,12 @@ export default class AudioFix {
9
9
  private _mediaSource;
10
10
  private _lastPacketsSent;
11
11
  private _lastPacketsSentTime;
12
+ private _toggleAudioPromise;
13
+ private _fixNoPacketsAppliedVideo;
12
14
  constructor(mediaSource: MediaSource);
13
15
  private _fixAudioDeviceNoPackets;
14
16
  private _fixAudioDeviceTooManyPackets;
15
17
  fix(rtps: any[]): void;
18
+ /** важно вызывать ___после___ метода `fix()` */
19
+ fixVideo(rtps: any[]): void;
16
20
  }
@@ -1,3 +1,4 @@
1
+ import { StatFirstMediaReceived } from './stat/StatFirstMediaReceived';
1
2
  type ParticipantAudioOutput = {
2
3
  audioElement?: HTMLAudioElement;
3
4
  audioTrack?: MediaStreamTrack;
@@ -6,6 +7,8 @@ export default class AudioOutput {
6
7
  protected _output: ParticipantAudioOutput | null;
7
8
  private _volume;
8
9
  private readonly _features;
10
+ private readonly _statFirstMediaReceived;
11
+ constructor(statFirstMediaReceived: StatFirstMediaReceived);
9
12
  add(track: MediaStreamTrack): void;
10
13
  remove(track: MediaStreamTrack): void;
11
14
  get volume(): number;
@@ -130,25 +130,13 @@ export default class Conversation extends EventEmitter {
130
130
  private _registerParticipantAndSetMarkersIfChunkEnabled;
131
131
  private _warnParticipantNotInConversation;
132
132
  private _denormalizeMarkers;
133
- /**
134
- * Обрабатывает данные connection из сигналинга. Должен вызываться после `_registerParticipants`
135
- *
136
- * @param connection
137
- */
138
- private _processConnectionData;
139
133
  /**
140
134
  * Обрабатывает информацию о сессионных залах
141
135
  *
142
136
  * @param connection
143
137
  */
144
138
  private _processRooms;
145
- private _extractConnectionPersonalMuteStates;
146
- /**
147
- * Обрабатывает информацию о мьютах в основном и сессионных залах
148
- * @param connection
149
- * @private
150
- * @hidden
151
- */
139
+ /** Обрабатывает информацию о мьютах в основном и сессионных залах */
152
140
  private _processMuteStates;
153
141
  /**
154
142
  * Обрабатывает информацию о записи/трансляции в основном и сессионных залах
@@ -253,7 +241,7 @@ export default class Conversation extends EventEmitter {
253
241
  getWaitingHall(pageMarker: string | null, count?: number, backward?: boolean): Promise<WaitingHallResponse>;
254
242
  private _resolveWaitingHallExternalIds;
255
243
  getAudienceModeHands(): Promise<AudienceModeHandsResponse>;
256
- promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<void>;
244
+ promoteParticipant(participantId?: CompositeUserId, demote?: boolean): Promise<void>;
257
245
  requestPromotion(unrequest?: boolean): Promise<void>;
258
246
  acceptPromotion(reject?: boolean): Promise<void>;
259
247
  chatMessage(message: string, participantId?: CompositeUserId | null): Promise<void>;
@@ -284,8 +272,9 @@ export default class Conversation extends EventEmitter {
284
272
  setLocalResolution({ video, effect }: {
285
273
  video: IVideoDimentions;
286
274
  effect?: IVideoDimentions;
287
- }): Promise<void | undefined>;
275
+ }): Promise<void>;
288
276
  videoEffect(effect: IEffect | null): Promise<void | undefined>;
277
+ audioEffect(effects: string[] | null, isPreset?: boolean): Promise<void | undefined>;
289
278
  _convertExternalIdsToServerExternalIds(externalIds: ExternalId[]): SignalingMessage.ExternalId[];
290
279
  getParticipants(parameters: IGetParticipantsParameters): Promise<ExternalParticipant[]>;
291
280
  getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<ExternalParticipantListChunk>;
@@ -366,6 +355,7 @@ export default class Conversation extends EventEmitter {
366
355
  private _onRemoteSignalledStall;
367
356
  private _onRemoteDataStats;
368
357
  private _fixAudioDevice;
358
+ private _fixVideoDevice;
369
359
  private _toggleJoinAvailability;
370
360
  private _updateDisplayLayoutFromCache;
371
361
  private _setParticipantsStatus;
@@ -18,6 +18,17 @@ export declare const enum MediaTrackKind {
18
18
  'screen' = "screen",
19
19
  'audioshare' = "audioshare"
20
20
  }
21
+ interface AudioEffectParams {
22
+ effects: string[];
23
+ isPreset?: boolean;
24
+ }
25
+ /**
26
+ * тип источника (для сервера)
27
+ */
28
+ export declare enum MediaSourceType {
29
+ CAMERA = 1,
30
+ SCREEN = 2
31
+ }
21
32
  export declare class MediaSource extends EventEmitter {
22
33
  /** Стрим с камеры и микрофона пользователя */
23
34
  protected _stream: MediaStream | null;
@@ -25,16 +36,21 @@ export declare class MediaSource extends EventEmitter {
25
36
  private _audioShareTrack;
26
37
  /** Трек для отправки в медиа-канал. Может отличаться при скриншаринге в дата-канал */
27
38
  private _sendVideoTrack;
28
- /** Трек с камеры. В стриме будет другой трек при включенных эффектах */
39
+ /** Трек с камеры. В стриме будет другой трек при включенных видео эффектах */
29
40
  private _cameraVideoTrack;
41
+ /** Трек с микрофона. В стриме будет другой трек при включенных аудио эффектах */
42
+ private _micAudioTrack;
43
+ /** Трек аудио эффектов. Не изменяется на протяжении всего времени */
44
+ private _audioEffectsTrack;
30
45
  private _mediaSettings;
31
46
  private _videoStatusOnScreenCapturingEnabled;
32
47
  private _effect;
48
+ private _audioEffectParams;
33
49
  private _onDeviceChange;
34
- /** MediaSource занят при переключении камеры или микрофона */
35
- private _sourceBusy;
36
50
  /** Состояние выключателя Animoji в UI */
37
51
  private _animojiEnabled;
52
+ /** вычисляем низкую производительность видео эффектов */
53
+ private readonly _videoEffectsFpsLimiter?;
38
54
  constructor();
39
55
  request(mediaOptions?: MediaOption[], needEmptyTracks?: boolean): Promise<void>;
40
56
  getStream(): MediaStream | null;
@@ -60,13 +76,12 @@ export declare class MediaSource extends EventEmitter {
60
76
  * Может использоваться для тестирования.
61
77
  */
62
78
  setAudioStream(stream: MediaStream): Promise<void>;
63
- private _busy;
64
- private _free;
65
79
  private _changeAudioInput;
66
80
  private _changeScreen;
67
81
  private _disableScreenCapture;
68
82
  private disableAudioShare;
69
83
  private stopAudioShareTrack;
84
+ private _applyAudioEffect;
70
85
  protected getSilentAudioShareTrack(): MediaStreamTrack;
71
86
  protected _replaceLocalTrack(newTrack: MediaStreamTrack, sendTrack?: MediaStreamTrack): Promise<void>;
72
87
  private _setEffect;
@@ -82,7 +97,13 @@ export declare class MediaSource extends EventEmitter {
82
97
  video: IVideoDimentions;
83
98
  effect?: IVideoDimentions;
84
99
  }): Promise<void>;
100
+ getCameraVideoTrack(): MediaStreamTrack | null;
85
101
  updateNoiseSuppression(): Promise<void>;
86
102
  videoEffect(effect: IEffect | null): Promise<void>;
103
+ audioEffect(audioEffectParams: AudioEffectParams | null): Promise<void>;
87
104
  getAudioShareTrack(): MediaStreamTrack | null;
105
+ private handleVideoEffectsLowFps;
106
+ private get _frameRate();
107
+ private _applyVideoConstraints;
88
108
  }
109
+ export {};
@@ -5,6 +5,7 @@ import { EnableVideoSuspend } from '../types/EnableVideoSuspend';
5
5
  import { EnableVideoSuspendSuggest } from '../types/EnableVideoSuspendSuggest';
6
6
  import SignalingMessage from '../types/SignalingMessage';
7
7
  import { PerfStatReport } from '../types/PerfStatReporter';
8
+ import { ChangeSimulcast } from '../types/ChangeSimulcast';
8
9
  import { SharingStatReport } from './screenshare/SharingStatReport';
9
10
  import { ParticipantIdRegistry } from './ParticipantIdRegistry';
10
11
  export declare class ProducerCommandSerializationService {
@@ -21,6 +22,7 @@ export declare class ProducerCommandSerializationService {
21
22
  serializeNetworkStatReport(sequenceNumber: number, report: NetworkStatReport): ArrayBuffer;
22
23
  serializeEnableVideoSuspend(sequenceNumber: number, params: EnableVideoSuspend): ArrayBuffer;
23
24
  serializeEnableVideoSuspendSuggest(sequenceNumber: number, params: EnableVideoSuspendSuggest): ArrayBuffer;
25
+ serializeChangeSimulcast(sequenceNumber: number, params: ChangeSimulcast): ArrayBuffer;
24
26
  deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
25
27
  private deserializeUpdateDisplayLayoutResponse;
26
28
  private deserializeReportPerfStatResponse;
@@ -0,0 +1,23 @@
1
+ import type { VideoEffects } from '@vkontakte/calls-video-effects';
2
+ import EventEmitter from './EventEmitter';
3
+ export declare enum VideoEffectsFpsLimiterEvent {
4
+ FpsLimit = "fps-limit"
5
+ }
6
+ export declare class VideoEffectsFpsLimiter extends EventEmitter {
7
+ private readonly FPS_LIMITS;
8
+ private readonly THRESHOLD;
9
+ private readonly HISTORY_LENGTH;
10
+ private _fpsMeterUnsubscribe;
11
+ private readonly _fpsHistory;
12
+ private _fpsLimitCursor;
13
+ get fpsLimit(): number;
14
+ watch(videoEffect: VideoEffects | null): void;
15
+ private _handleFpsMeter;
16
+ /** для совместимости со старыми версиями, где может не быть метода */
17
+ private _assertsVideoEffect;
18
+ addEventListener(event: VideoEffectsFpsLimiterEvent, fn: (fpsLimit: number) => void): {
19
+ dispose: Function;
20
+ };
21
+ private _cleanup;
22
+ destroy(): void;
23
+ }
@@ -1,5 +1,5 @@
1
1
  export default interface IDecoder {
2
- init(onFrameImage: (image: VideoFrame | ImageData) => void): Promise<void>;
2
+ init(onFrameImage: (image: VideoFrame | ImageData) => void, onFrameError?: (error: unknown) => void): Promise<void>;
3
3
  decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
4
4
  destroy(): void;
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import IDecoder from './IDecoder';
2
2
  import WorkerBase from './WorkerBase';
3
3
  export default class LibVPxDecoder extends WorkerBase implements IDecoder {
4
- init(onFrameImage: (image: ImageData) => void): Promise<void>;
4
+ init(onFrameImage: (image: ImageData) => void, onFrameError: (error: unknown) => void): Promise<void>;
5
5
  decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
6
6
  destroy(): void;
7
7
  static isBrowserSupported(): boolean;
@@ -11,8 +11,6 @@ export default class LibVPxEncoder extends WorkerBase implements IEncoder {
11
11
  private _imageCapture;
12
12
  private _canvas;
13
13
  private _canvasCtx;
14
- private _stream;
15
- private _track;
16
14
  private _frameReadTimeout;
17
15
  private _lastFrame;
18
16
  constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number);
@@ -23,7 +21,6 @@ export default class LibVPxEncoder extends WorkerBase implements IEncoder {
23
21
  private _drawFrameVideo;
24
22
  private _getFrameBitmap;
25
23
  private _drawFrameData;
26
- private _requestCanvasFrame;
27
24
  init(): Promise<void>;
28
25
  private _encode;
29
26
  private _requestFrameVideo;
@@ -1,7 +1,7 @@
1
1
  import IDecoder from './IDecoder';
2
2
  import WorkerBase from './WorkerBase';
3
3
  export default class WebCodecsDecoder extends WorkerBase implements IDecoder {
4
- init(onFrameImage: (frame: VideoFrame) => void): Promise<void>;
4
+ init(onFrameImage: (frame: VideoFrame) => void, onFrameError: (error: unknown) => void): Promise<void>;
5
5
  decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
6
6
  destroy(): void;
7
7
  static isBrowserSupported(): boolean;
@@ -1,4 +1,3 @@
1
- import SignalingMessage from '../../types/SignalingMessage';
2
1
  import { TransportTopology } from '../transport/Transport';
3
2
  /** связанный с операцией `first_media_received` тип логируемого звонка */
4
3
  declare enum ECallType {
@@ -11,11 +10,13 @@ declare enum ECallType {
11
10
  export declare class StatFirstMediaReceived {
12
11
  /** уже поставили засечку на приём звонка */
13
12
  protected _isCallMarked: boolean;
14
- protected static _callType: ECallType | null;
15
- measureSignalingConnection(connection?: SignalingMessage.Connection): void;
13
+ protected _isFinished: boolean;
14
+ protected _callType: ECallType | null;
16
15
  markAcceptCall(topology: TransportTopology): void;
17
- markAcceptedCall(topology: TransportTopology): void;
16
+ markAcceptedCall(topology?: TransportTopology): void;
18
17
  markParticipantJoined(topology: TransportTopology): void;
19
- static measure(): void;
18
+ markOnJoin(topology: TransportTopology): void;
19
+ private mark;
20
+ measure(): void;
20
21
  }
21
22
  export {};
@@ -35,6 +35,7 @@ export default class ServerTransport extends BaseTransport {
35
35
  private _rtpReceiversByStreamId;
36
36
  private _producerSessionId;
37
37
  private _newAudioShareTrack;
38
+ private _simulcastInfo;
38
39
  constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings);
39
40
  updateStatisticsInterval(): void;
40
41
  open(observer?: boolean): void;
@@ -44,6 +45,7 @@ export default class ServerTransport extends BaseTransport {
44
45
  allowRestart(): void;
45
46
  updateSettings(settings: ServerSettings): void;
46
47
  setAnimojiTransport(receiver: AnimojiReceiver, sender: AnimojiSender): void;
48
+ onCameraResolutionChanged(): Promise<void>;
47
49
  private _createPerfStatsReporter;
48
50
  private _closeConnection;
49
51
  private static _closeDataChannel;
@@ -72,6 +74,8 @@ export default class ServerTransport extends BaseTransport {
72
74
  private _detectStaleTracks;
73
75
  private _allocateConsumer;
74
76
  private _processOffer;
77
+ private _findFirstSimTransceiver;
78
+ private _setupSimulcastTransceiver;
75
79
  private _acceptProducer;
76
80
  private _handleTracks;
77
81
  private _onSignalingNotification;
@@ -82,4 +86,5 @@ export default class ServerTransport extends BaseTransport {
82
86
  private _onConnectionStateChange;
83
87
  private _onReplacedTrack;
84
88
  getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
89
+ private _changeSimulcastInfo;
85
90
  }
@@ -66,6 +66,7 @@ export declare class Transport extends EventEmitter {
66
66
  getStates(): Record<string, TransportState>;
67
67
  setAnimojiSvg(participantId: ParticipantId, svgData: AnimojiSvgData): void;
68
68
  setAnimojiFill(fill: RGBTuple | string): void;
69
+ onCameraResolutionChanged(): Promise<void>;
69
70
  private _setStates;
70
71
  private _setLocalState;
71
72
  private _onSignalingNotification;
package/default/Api.d.ts CHANGED
@@ -17,6 +17,7 @@ export default class Api extends BaseApi {
17
17
  log(items: LogItem[]): void;
18
18
  logClientStats(items: ClientStats[]): void;
19
19
  logClientEvents(items: ClientEvent[]): void;
20
+ uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
20
21
  joinConversation(conversationId: string, isVideo?: boolean, chatId?: string): Promise<ConversationResponse>;
21
22
  createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie, audienceMode, audioOnly, }?: {
22
23
  onlyAdminCanShareMovie?: boolean;
@@ -20,6 +20,7 @@ import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/Partici
20
20
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
21
21
  import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
22
22
  import { PerfStatReport } from '../types/PerfStatReporter';
23
+ import { ChangeSimulcast } from '../types/ChangeSimulcast';
23
24
  import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse, SignalingSuccessResponse } from '../types/SignalingMessage';
24
25
  import { IPublishStreamData, IRecordConfData, IStartStreamData, IStopStreamData } from '../types/Streams';
25
26
  export default class Signaling extends BaseSignaling {
@@ -132,11 +133,12 @@ export default class Signaling extends BaseSignaling {
132
133
  updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
133
134
  enableVideoSuspend(enabled: boolean): Promise<SignalingMessage>;
134
135
  enableVideoSuspendSuggest(enabled: boolean): Promise<SignalingMessage>;
136
+ changeSimulcast(changeSimulcast: ChangeSimulcast): Promise<SignalingMessage>;
135
137
  changeOptions(changes: {
136
138
  [key in ConversationOption]?: boolean;
137
139
  }): Promise<SignalingMessage>;
138
140
  getWaitingHall(fromId?: SignalingMessage.WaitingParticipantId | null, count?: number, backward?: boolean): Promise<SignalingMessage>;
139
- promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
141
+ promoteParticipant(participantId?: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
140
142
  requestPromotion(unrequest?: boolean): Promise<SignalingMessage>;
141
143
  acceptPromotion(reject?: boolean): Promise<SignalingMessage>;
142
144
  feedback(key: string): Promise<SignalingMessage>;
@@ -16,6 +16,7 @@ declare enum FatalError {
16
16
  UNSUPPORTED = "unsupported",
17
17
  SIGNALING_FAILED = "signalingfailed",
18
18
  API = "api",
19
- AUTH = "auth"
19
+ AUTH = "auth",
20
+ OVERCONSTRAINED = "overconstrained"
20
21
  }
21
22
  export default FatalError;
@@ -55,6 +55,7 @@ declare enum SignalingCommandType {
55
55
  GET_HAND_QUEUE = "get-hand-queue",
56
56
  ENABLE_VIDEO_SUSPEND = "enable-video-suspend",
57
57
  ENABLE_VIDEO_SUSPEND_SUGGEST = "enable-video-suspend-suggest",
58
- PUT_HANDS_DOWN = "put-hands-down"
58
+ PUT_HANDS_DOWN = "put-hands-down",
59
+ CHANGE_SIMULCAST = "change-simulcast"
59
60
  }
60
61
  export default SignalingCommandType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.5-dev.086cc589.0",
3
+ "version": "2.8.5-dev.0c1f6988.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,8 +14,9 @@
14
14
  "**/*.d.ts"
15
15
  ],
16
16
  "dependencies": {
17
- "@vkontakte/calls-video-effects": "2.2.3-beta.2",
18
- "@vkontakte/calls-vmoji": "1.0.10-beta.6",
17
+ "@vkontakte/calls-audio-effects": "1.2.6",
18
+ "@vkontakte/calls-video-effects": "2.2.3-beta.5",
19
+ "@vkontakte/calls-vmoji": "1.0.10-beta.15",
19
20
  "@vkontakte/libvpx": "2.0.9",
20
21
  "bit-buffer": "0.2.5",
21
22
  "messagepack": "1.1.12",
@@ -6,3 +6,4 @@ export declare function sendBeakon(method: string, params?: {
6
6
  export declare function request(method: string, params?: {
7
7
  [key: string]: any;
8
8
  }, noSession?: boolean, customEndpoint?: string): Promise<unknown>;
9
+ export declare function sendFormData(url: string, data: FormData): Promise<void>;
@@ -0,0 +1,13 @@
1
+ import { CurrentLogItem } from '../utils/DebugStorage';
2
+ export declare class ConversationDebugLogger {
3
+ private static _list;
4
+ private static _conversationId;
5
+ static get startTime(): number;
6
+ static get endTime(): number;
7
+ static startSession(): void;
8
+ static get conversationId(): string | null;
9
+ static set conversationId(conversationId: string | null);
10
+ static add(item: CurrentLogItem): void;
11
+ private static _createContextLogs;
12
+ static collectLogs(): CurrentLogItem[];
13
+ }
@@ -303,8 +303,9 @@ declare namespace External {
303
303
  *
304
304
  * @param userId Внешний ID пользователя
305
305
  * @param roles Список ролей
306
+ * @param isInitial Коллбек вызван при инициализации (переподключение в звонок, заранее назначенный админ)
306
307
  */
307
- function onRolesChanged(userId: ExternalId, roles: UserRole[]): void;
308
+ function onRolesChanged(userId: ExternalId, roles: UserRole[], isInitial?: boolean): void;
308
309
  /**
309
310
  * Изменились свои роли в звонке
310
311
  *
@@ -1,4 +1,5 @@
1
1
  import type { VideoEffects } from '@vkontakte/calls-video-effects';
2
+ import type { EffectVoiceChange } from '@vkontakte/calls-audio-effects';
2
3
  import type * as Vmoji from '@vkontakte/calls-vmoji';
3
4
  import { IAsrData } from '../types/Asr';
4
5
  import { ConversationData } from '../types/Conversation';
@@ -159,6 +160,12 @@ export type ParamsObject = {
159
160
  * Можно установить позднее методом `setVideoEffects`
160
161
  */
161
162
  videoEffects: VideoEffects | null;
163
+ /**
164
+ * Экземпляр класса `AudioEffects` из [`@vkontakte/calls-audio-effects`](https://npmjs.com/package/@vkontakte/calls-audio-effects)
165
+ *
166
+ * Можно установить позднее методом `setAudioEffects`
167
+ */
168
+ audioEffects: EffectVoiceChange | null;
162
169
  /**
163
170
  * Максимальная ширина видео в пикселях для видео эффекта
164
171
  *
@@ -244,7 +251,7 @@ export type ParamsObject = {
244
251
  * Отдавать приоритет кодеку VP9 для исходящего видео,
245
252
  * если preferH264 тоже выставлен в true то первый приоритет будет у VP9, второй у H264
246
253
  *
247
- * _По умолчанию: `true`_
254
+ * _По умолчанию: `false`_
248
255
  */
249
256
  preferVP9: boolean;
250
257
  /** @hidden */
@@ -591,7 +598,7 @@ export type ParamsObject = {
591
598
  /**
592
599
  * Изменились роли собеседника в звонке
593
600
  */
594
- onRolesChanged?: (userId: ExternalParticipantId, roles: UserRole[]) => void;
601
+ onRolesChanged?: (userId: ExternalParticipantId, roles: UserRole[], isInitial?: boolean) => void;
595
602
  /**
596
603
  * Изменились свои роли в звонке
597
604
  */
@@ -826,6 +833,14 @@ export type ParamsObject = {
826
833
  * _По умолчанию: `false`_
827
834
  */
828
835
  switchVideoAtBadNetwork: boolean;
836
+ /** включает деградацию фпс для видео с камеры при низком фпс с включенными вирт фонами */
837
+ enableVideoEffectsFpsDegradation: boolean;
838
+ /**
839
+ * Включить поддержку simulcast на отправке
840
+ *
841
+ * _По умолчанию: `false`_
842
+ */
843
+ simulcast: boolean;
829
844
  };
830
845
  export default abstract class Params {
831
846
  private static _params;
@@ -883,6 +898,8 @@ export default abstract class Params {
883
898
  static get videoFacingMode(): FacingMode | null;
884
899
  static set videoFacingMode(value: FacingMode | null);
885
900
  static get displaySurface(): DisplayCaptureSurfaceType;
901
+ static get audioEffects(): EffectVoiceChange | null;
902
+ static set audioEffects(value: EffectVoiceChange | null);
886
903
  static get videoEffects(): VideoEffects | null;
887
904
  static set videoEffects(value: VideoEffects | null);
888
905
  static get videoEffectMaxWidth(): number;
@@ -948,4 +965,36 @@ export default abstract class Params {
948
965
  static get enumerateDevicesDelay(): number;
949
966
  static getScreenFrameRate(fastScreenShare: boolean): number;
950
967
  static get switchVideoAtBadNetwork(): boolean;
968
+ static get enableVideoEffectsFpsDegradation(): boolean;
969
+ static get simulcast(): boolean;
970
+ static set simulcast(value: boolean);
971
+ static toJSON(): {
972
+ apiKey: string;
973
+ apiEnv: string;
974
+ audioShare: boolean;
975
+ useCallsToContacts: boolean;
976
+ useParticipantListChunk: boolean;
977
+ useRooms: boolean;
978
+ useChatRooms: boolean;
979
+ fastScreenShare: boolean;
980
+ participantListChunkInitCount: number | null;
981
+ screenShareCongestionControl: boolean;
982
+ screenShareCongestionControlThreshold: number;
983
+ videoTracksCount: number;
984
+ asrDataChannel: boolean;
985
+ videoMaxHeight: number;
986
+ videoMaxWidth: number;
987
+ videoEffectMaxHeight: number;
988
+ videoEffectMaxWidth: number;
989
+ videoSuspend: boolean;
990
+ debugLog: boolean;
991
+ callStatReportEnabled: boolean;
992
+ joinFromMultipleDevices: boolean;
993
+ movieShare: boolean;
994
+ newMuteRules: boolean;
995
+ clientType: string;
996
+ clientStatsPlatform: string;
997
+ consumerScreenDataChannelPacketSize: number;
998
+ switchVideoAtBadNetwork: boolean;
999
+ };
951
1000
  }
@@ -0,0 +1,13 @@
1
+ import { type SimulcastInfo as ISimulcastInfo } from '../types/SimulcastInfo';
2
+ import type { VideoBitrateSettings } from '../types/VideoSettings';
3
+ export declare const SIMULCAST_DEFAULT: {
4
+ HEIGHT: number;
5
+ WIDTH: number;
6
+ BITRATE: number;
7
+ };
8
+ export declare const MAP_RID_TO_SCALE_RESOLUTION_DOWN_BY: Record<string, number>;
9
+ export declare function getSimulcastInfo(stats?: RTCOutboundRtpStreamStats[], bitrates?: VideoBitrateSettings[]): ISimulcastInfo;
10
+ export declare function isEqualSimulcastInfo(si1: ISimulcastInfo | null, si2: ISimulcastInfo | null): boolean;
11
+ export declare function findBitrateAsc(dimention: number, bitrates?: VideoBitrateSettings[]): number | undefined;
12
+ export declare function calculateSimulcastInfo(width?: number, height?: number, bitrates?: VideoBitrateSettings[]): ISimulcastInfo;
13
+ export declare function findScaleResolutionDownBy(rid: string): number;
package/static/Utils.d.ts CHANGED
@@ -7,7 +7,7 @@ export declare const PARAMETERS_SEPARATOR = ":";
7
7
  export declare const DEVICE_IDX_PARAMETER = "d";
8
8
  /** @hidden */
9
9
  declare namespace Utils {
10
- function patchLocalSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, h264spsPpsIdrInKeyframe: boolean, isAudioNack?: boolean, preferRed?: boolean): string;
10
+ function patchLocalSDP(sdp: string, preferH264: boolean, brokenH264Decoder: boolean, preferVP9: boolean, h264spsPpsIdrInKeyframe: boolean, isAudioNack?: boolean, preferRed?: boolean): string;
11
11
  function patchRemoteSDP(sdp: string, oldDataChannelDescription: boolean, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, brokenVP9Encoder: boolean, brokenVP9Decoder: boolean): string;
12
12
  function getPeerIdString(peerId: SignalingMessage.PeerId): string;
13
13
  function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
@@ -31,7 +31,7 @@ declare namespace Utils {
31
31
  deviceIdx: number;
32
32
  };
33
33
  function uuid(): string;
34
- function throttle(func: Function, ms: number): (this: any) => void;
34
+ function debounce<F extends (...args: Parameters<F>) => ReturnType<F>>(func: F, ms: number): (this: any, ..._args: Parameters<F>) => void;
35
35
  function sdpFingerprint(sdp: string): bigint | null;
36
36
  function delay(time: number): Promise<unknown>;
37
37
  function applySettings(pc: RTCPeerConnection, videoSettings: VideoSettings, prevSettings: any): any;
@@ -61,7 +61,7 @@ declare namespace Utils {
61
61
  [key in T]?: K;
62
62
  }, obj2: {
63
63
  [key in T]?: K;
64
- }): boolean;
64
+ }, deep?: boolean): boolean;
65
65
  function isArraysEquals<T>(arr1: T[], arr2: T[]): boolean;
66
66
  function isEmptyObject(obj: object): boolean;
67
67
  /**
@@ -74,5 +74,6 @@ declare namespace Utils {
74
74
  function objectReduce<R, T extends Object>(obj: T, callback: (acc: R, value: T[keyof T], key: keyof T) => R, initialValue: R): R;
75
75
  const setImmediate: (fn: VoidFunction) => VoidFunction;
76
76
  function isObject(obj: unknown): obj is object;
77
+ function patchSimulcastAnswerSdp(sdp: string, trans: RTCRtpTransceiver, width: number, height: number): string;
77
78
  }
78
79
  export default Utils;
@@ -23,7 +23,7 @@ declare namespace WebRTCUtils {
23
23
  /**
24
24
  * Инициализирует устройства. До вызова этого метода бесполезно опрашивать другие публичные методы
25
25
  */
26
- function init(): Promise<MediaDeviceInfo[]>;
26
+ function init(): Promise<void>;
27
27
  /**
28
28
  * Возвращает все подключенные камеры
29
29
  */
@@ -68,6 +68,7 @@ declare namespace WebRTCUtils {
68
68
  * Проверяет получен ли доступ к микрофону
69
69
  */
70
70
  function hasMicrophonePermission(): boolean;
71
+ function getMicrophonePermissionState(): PermissionState | null;
71
72
  /**
72
73
  * Проверяет получены ли разрешения, необходимые для текущего звонка
73
74
  */
@@ -121,11 +122,12 @@ declare namespace WebRTCUtils {
121
122
  */
122
123
  function isScreenCapturingSupported(): boolean;
123
124
  /**
124
- * В некоторых браузерах H264 сломан
125
+ * В некоторых браузерах H264 decoder сломан
125
126
  */
126
- function isBrokenH264(): boolean;
127
+ function isBrokenH264Decoder(): boolean;
127
128
  /**
128
129
  * В некоторых браузерах VP9 encoder сломан
130
+ * В симулкасте вп9 енкодер ведет себя некорректно
129
131
  */
130
132
  function isBrokenVP9Encoder(): boolean;
131
133
  /**
@@ -0,0 +1,6 @@
1
+ import { MediaSourceType } from '../classes/MediaSource';
2
+ import { SimulcastInfo } from './SimulcastInfo';
3
+ export type ChangeSimulcast = {
4
+ mediaSource: MediaSourceType;
5
+ simulcastInfo: SimulcastInfo;
6
+ };
@@ -2,27 +2,15 @@ import { TransportTopology } from '../classes/transport/Transport';
2
2
  import CallDirection from '../enums/CallDirection';
3
3
  import ConversationFeature from '../enums/ConversationFeature';
4
4
  import ConversationOption from '../enums/ConversationOption';
5
- import MediaOption from '../enums/MediaOption';
6
5
  import UserRole from '../enums/UserRole';
7
6
  import { AsrInfo } from './Asr';
8
7
  import { IFeaturesPerRole } from './ConversationFeature';
9
8
  import { ExternalParticipantId } from './ExternalId';
10
9
  import MediaModifiers from './MediaModifiers';
11
- import MediaSettings from './MediaSettings';
12
10
  import MuteStates from './MuteStates';
13
- import { OkUserId, Participant, ParticipantId } from './Participant';
11
+ import { OkUserId, ParticipantId } from './Participant';
14
12
  import { IRoomId, RoomUrlSharingInfo } from './Room';
15
13
  import { RecordInfo } from './SignalingMessage';
16
- export interface IProcessMuteStateParams {
17
- mediaOptions?: MediaOption[];
18
- muteAll?: boolean;
19
- unmute?: boolean;
20
- serverSettings?: MediaSettings | null;
21
- admin?: Participant | null;
22
- stateUpdated?: boolean;
23
- requestedMedia?: MediaOption[];
24
- roomId?: IRoomId;
25
- }
26
14
  /**
27
15
  * Данные текущего звонка
28
16
  */
@@ -70,7 +58,7 @@ export type ConversationData = {
70
58
  mediaModifiers: MediaModifiers;
71
59
  options: ConversationOption[];
72
60
  muteStates: Map<IRoomId, MuteStates>;
73
- unmuteOptions: MediaOption[];
61
+ muteStatesPersonal: MuteStates;
74
62
  networkRating: number;
75
63
  waitingHall: boolean;
76
64
  observer: boolean;
@@ -0,0 +1,6 @@
1
+ export type GetLogUploadUrlParams = {
2
+ conversationId: string;
3
+ webrtcPlatform: string;
4
+ startTime: number;
5
+ endTime: number;
6
+ };
@@ -0,0 +1,3 @@
1
+ export type GetLogUploadUrlResponse = {
2
+ upload_url: string;
3
+ };