@vkontakte/calls-sdk 2.8.5-dev.0963bd63.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 (37) hide show
  1. package/CallsSDK.d.ts +6 -1
  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 +4 -15
  9. package/classes/MediaSource.d.ts +13 -0
  10. package/classes/ProducerCommandSerializationService.d.ts +2 -0
  11. package/classes/VideoEffectsFpsLimiter.d.ts +23 -0
  12. package/classes/stat/StatFirstMediaReceived.d.ts +1 -1
  13. package/classes/transport/ServerTransport.d.ts +5 -0
  14. package/classes/transport/Transport.d.ts +1 -0
  15. package/default/Api.d.ts +1 -0
  16. package/default/Signaling.d.ts +3 -1
  17. package/enums/FatalError.d.ts +2 -1
  18. package/enums/SignalingCommandType.d.ts +2 -1
  19. package/package.json +4 -4
  20. package/static/ApiTransport.d.ts +1 -0
  21. package/static/ConversationDebugLogger.d.ts +13 -0
  22. package/static/Params.d.ts +40 -0
  23. package/static/SimulcastInfo.d.ts +13 -0
  24. package/static/Utils.d.ts +2 -1
  25. package/static/WebRTCUtils.d.ts +3 -1
  26. package/types/ChangeSimulcast.d.ts +6 -0
  27. package/types/Conversation.d.ts +2 -12
  28. package/types/GetLogUploadUrlParams.d.ts +6 -0
  29. package/types/GetLogUploadUrlResponse.d.ts +3 -0
  30. package/types/Params.d.ts +1 -1
  31. package/types/SimulcastInfo.d.ts +10 -0
  32. package/types/Statistics.d.ts +11 -4
  33. package/types/VideoSettings.d.ts +12 -0
  34. package/utils/Conversation.d.ts +4 -0
  35. package/utils/DebugStorage.d.ts +6 -0
  36. package/utils/Media.d.ts +1 -2
  37. 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,7 +272,7 @@ 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>;
289
277
  audioEffect(effects: string[] | null, isPreset?: boolean): Promise<void | undefined>;
290
278
  _convertExternalIdsToServerExternalIds(externalIds: ExternalId[]): SignalingMessage.ExternalId[];
@@ -367,6 +355,7 @@ export default class Conversation extends EventEmitter {
367
355
  private _onRemoteSignalledStall;
368
356
  private _onRemoteDataStats;
369
357
  private _fixAudioDevice;
358
+ private _fixVideoDevice;
370
359
  private _toggleJoinAvailability;
371
360
  private _updateDisplayLayoutFromCache;
372
361
  private _setParticipantsStatus;
@@ -22,6 +22,13 @@ interface AudioEffectParams {
22
22
  effects: string[];
23
23
  isPreset?: boolean;
24
24
  }
25
+ /**
26
+ * тип источника (для сервера)
27
+ */
28
+ export declare enum MediaSourceType {
29
+ CAMERA = 1,
30
+ SCREEN = 2
31
+ }
25
32
  export declare class MediaSource extends EventEmitter {
26
33
  /** Стрим с камеры и микрофона пользователя */
27
34
  protected _stream: MediaStream | null;
@@ -42,6 +49,8 @@ export declare class MediaSource extends EventEmitter {
42
49
  private _onDeviceChange;
43
50
  /** Состояние выключателя Animoji в UI */
44
51
  private _animojiEnabled;
52
+ /** вычисляем низкую производительность видео эффектов */
53
+ private readonly _videoEffectsFpsLimiter?;
45
54
  constructor();
46
55
  request(mediaOptions?: MediaOption[], needEmptyTracks?: boolean): Promise<void>;
47
56
  getStream(): MediaStream | null;
@@ -88,9 +97,13 @@ export declare class MediaSource extends EventEmitter {
88
97
  video: IVideoDimentions;
89
98
  effect?: IVideoDimentions;
90
99
  }): Promise<void>;
100
+ getCameraVideoTrack(): MediaStreamTrack | null;
91
101
  updateNoiseSuppression(): Promise<void>;
92
102
  videoEffect(effect: IEffect | null): Promise<void>;
93
103
  audioEffect(audioEffectParams: AudioEffectParams | null): Promise<void>;
94
104
  getAudioShareTrack(): MediaStreamTrack | null;
105
+ private handleVideoEffectsLowFps;
106
+ private get _frameRate();
107
+ private _applyVideoConstraints;
95
108
  }
96
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
+ }
@@ -17,6 +17,6 @@ export declare class StatFirstMediaReceived {
17
17
  markParticipantJoined(topology: TransportTopology): void;
18
18
  markOnJoin(topology: TransportTopology): void;
19
19
  private mark;
20
- measure(mediaStreamTrackKind: MediaStreamTrack['kind']): void;
20
+ measure(): void;
21
21
  }
22
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.0963bd63.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,9 +14,9 @@
14
14
  "**/*.d.ts"
15
15
  ],
16
16
  "dependencies": {
17
- "@vkontakte/calls-audio-effects": "1.2.4",
18
- "@vkontakte/calls-video-effects": "2.2.3-beta.2",
19
- "@vkontakte/calls-vmoji": "1.0.10-beta.13",
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",
20
20
  "@vkontakte/libvpx": "2.0.9",
21
21
  "bit-buffer": "0.2.5",
22
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
+ }
@@ -833,6 +833,14 @@ export type ParamsObject = {
833
833
  * _По умолчанию: `false`_
834
834
  */
835
835
  switchVideoAtBadNetwork: boolean;
836
+ /** включает деградацию фпс для видео с камеры при низком фпс с включенными вирт фонами */
837
+ enableVideoEffectsFpsDegradation: boolean;
838
+ /**
839
+ * Включить поддержку simulcast на отправке
840
+ *
841
+ * _По умолчанию: `false`_
842
+ */
843
+ simulcast: boolean;
836
844
  };
837
845
  export default abstract class Params {
838
846
  private static _params;
@@ -957,4 +965,36 @@ export default abstract class Params {
957
965
  static get enumerateDevicesDelay(): number;
958
966
  static getScreenFrameRate(fastScreenShare: boolean): number;
959
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
+ };
960
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
@@ -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
  */
@@ -126,6 +127,7 @@ declare namespace WebRTCUtils {
126
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,25 +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
10
  import MuteStates from './MuteStates';
12
- import { OkUserId, Participant, ParticipantId } from './Participant';
11
+ import { OkUserId, ParticipantId } from './Participant';
13
12
  import { IRoomId, RoomUrlSharingInfo } from './Room';
14
13
  import { RecordInfo } from './SignalingMessage';
15
- export interface IProcessMuteStateParams {
16
- mediaOptions?: MediaOption[];
17
- muteAll?: boolean;
18
- unmute?: boolean;
19
- admin?: Participant | null;
20
- stateUpdated?: boolean;
21
- requestedMedia?: MediaOption[];
22
- roomId?: IRoomId;
23
- }
24
14
  /**
25
15
  * Данные текущего звонка
26
16
  */
@@ -68,7 +58,7 @@ export type ConversationData = {
68
58
  mediaModifiers: MediaModifiers;
69
59
  options: ConversationOption[];
70
60
  muteStates: Map<IRoomId, MuteStates>;
71
- unmuteOptions: MediaOption[];
61
+ muteStatesPersonal: MuteStates;
72
62
  networkRating: number;
73
63
  waitingHall: boolean;
74
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
+ };
package/types/Params.d.ts CHANGED
@@ -1 +1 @@
1
- export type IApiEnv = 'AUTO' | 'PROD' | 'PROD_OK' | 'TEST' | 'VIDEOTEST' | string;
1
+ export type IApiEnv = 'AUTO' | 'PROD' | 'CALLS' | 'PROD_OK' | 'TEST' | 'VIDEOTEST' | 'CALLSTEST' | string;
@@ -0,0 +1,10 @@
1
+ export type SimulcastStreamInfo = {
2
+ rid: string;
3
+ width: number;
4
+ height: number;
5
+ fps: number;
6
+ bitrate: number;
7
+ };
8
+ export type SimulcastInfo = {
9
+ streams: SimulcastStreamInfo[];
10
+ };
@@ -24,7 +24,15 @@ export interface ILocalIceCandidateStat extends IRemoteIceCandidateStat {
24
24
  relayProtocol: string;
25
25
  networkType: RTCNetworkType;
26
26
  }
27
- export type StatRtp = {
27
+ interface StatRtpOutboundVideo {
28
+ frameHeight?: number;
29
+ frameWidth?: number;
30
+ rid?: string;
31
+ framesSent?: number;
32
+ framesPerSecond?: number;
33
+ targetBitrate?: number;
34
+ }
35
+ export interface StatRtp extends StatRtpOutboundVideo {
28
36
  ssrc: number;
29
37
  type: string;
30
38
  kind: string;
@@ -45,8 +53,6 @@ export type StatRtp = {
45
53
  packetLoss?: number;
46
54
  clockRate?: number;
47
55
  mimeType?: string;
48
- frameHeight?: number;
49
- frameWidth?: number;
50
56
  framesDecoded?: number;
51
57
  framesReceived?: number;
52
58
  framesDropped?: number;
@@ -63,7 +69,7 @@ export type StatRtp = {
63
69
  totalFreezesDurationDelta?: number;
64
70
  freezeCount: number;
65
71
  freezeCountDelta?: number;
66
- };
72
+ }
67
73
  export type StatItem = {
68
74
  timestamp: number;
69
75
  transport: StatTransport;
@@ -87,3 +93,4 @@ export type StatResult = {
87
93
  rtps: StatRtp[];
88
94
  };
89
95
  };
96
+ export {};
@@ -25,6 +25,10 @@ export type VideoSettings = {
25
25
  * https://www.w3.org/TR/webrtc-svc/
26
26
  */
27
27
  scalabilityMode: string;
28
+ /**
29
+ * Таблица с битрейтами в зависимости от разрешения
30
+ */
31
+ bitrates?: Record<'generic' | string, VideoBitrateSettings[]>;
28
32
  };
29
33
  export default VideoSettings;
30
34
  export declare function compareVideoSettings(vs1: VideoSettings | null, vs2: VideoSettings | null): boolean;
@@ -38,3 +42,11 @@ export declare enum VideoScalability {
38
42
  L1T2 = "L1T2",
39
43
  L1T3 = "L1T3"
40
44
  }
45
+ /**
46
+ * Настройка битрейта под конкретное разрешение
47
+ * @hidden
48
+ */
49
+ export type VideoBitrateSettings = {
50
+ dimension: number;
51
+ bitrate: number;
52
+ };
@@ -1,4 +1,8 @@
1
1
  import MediaOption from '../enums/MediaOption';
2
2
  import MuteState from '../enums/MuteState';
3
3
  import MuteStates from '../types/MuteStates';
4
+ import SignalingMessage from '../types/SignalingMessage';
4
5
  export declare const getMediaOptionsByMuteState: (muteStates: MuteStates, value: MuteState) => MediaOption[];
6
+ export declare function extractConnectionMuteStates(connection: SignalingMessage.Connection | SignalingMessage.PromoteParticipant): MuteStates | undefined;
7
+ export declare function filterReconnectedParticipantMuteStates(participant: SignalingMessage.Participant): MuteStates;
8
+ export declare function filterReconnectedConversationMuteStates(connection: SignalingMessage.Connection | SignalingMessage.PromoteParticipant, muteStates: MuteStates): MuteStates;
@@ -1,2 +1,8 @@
1
+ export type CurrentLogItem = {
2
+ readonly t: number;
3
+ readonly l: string;
4
+ readonly d: any[];
5
+ readonly h: string;
6
+ };
1
7
  export declare function add(level: string, args: any[]): void;
2
8
  export declare function init(): void;
package/utils/Media.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { IVideoDimentions } from '../types/MediaSettings';
2
1
  export declare const stopMediaStreamTrack: (track: MediaStreamTrack) => void;
3
2
  export declare const stopMediaStreamTracks: (stream: MediaStream) => void;
4
3
  export declare const stopMediaStreamVideoTracks: (stream: MediaStream) => void;
5
4
  export declare const cloneVideoTrack: (stream: MediaStream) => MediaStreamTrack;
6
- export declare function setVideoResolution(track: MediaStreamTrack, { width, height }: IVideoDimentions): Promise<void>;
5
+ export declare function setVideoConstraints(track: MediaStreamTrack, constraints: MediaTrackConstraints): Promise<void>;
@@ -0,0 +1,13 @@
1
+ type Device = 'camera' | 'microphone';
2
+ type PermissionStatusState = typeof PermissionStatus.prototype.state;
3
+ type EventListener = (name: Device, state: PermissionStatusState) => void;
4
+ export declare class NavigatorPermissions {
5
+ private _cameraPermissionStatus;
6
+ private _microphonePermissionStatus;
7
+ private _listener;
8
+ static isSupported(): boolean;
9
+ init(listener: EventListener): Promise<void>;
10
+ private handlePermissionChange;
11
+ getPermissionState(device: Device): PermissionState | null;
12
+ }
13
+ export {};