@vkontakte/calls-sdk 2.8.10 → 2.8.11-dev.5500645b.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.
@@ -60,6 +60,7 @@ export default class Conversation extends EventEmitter {
60
60
  private _audioFix;
61
61
  private _streamByStreamId;
62
62
  private _streamIdByStreamDescription;
63
+ private _participantIdByDebugStreamId;
63
64
  private _streamWaitTimerByStreamDescription;
64
65
  private _sequenceNumberByStreamDescription;
65
66
  private _cooldownTimestampByStreamDescription;
@@ -216,6 +217,7 @@ export default class Conversation extends EventEmitter {
216
217
  private _sendUpdateDisplayLayout;
217
218
  private _cleanupCooldownQueue;
218
219
  private _onParticipantSourcesUpdate;
220
+ private _registerVideoStreamDebugParticipant;
219
221
  private _onParticipantPromoted;
220
222
  private _onChatRoomUpdated;
221
223
  private _onSharedMovieUpdate;
@@ -372,6 +374,8 @@ export default class Conversation extends EventEmitter {
372
374
  private _onAudioMixStall;
373
375
  private _onRemoteSignalledStall;
374
376
  private _onRemoteDataStats;
377
+ private _onVideoStreamDebug;
378
+ private _resolveVideoStreamDebugParticipantId;
375
379
  private _fixAudioDevice;
376
380
  private _fixVideoDevice;
377
381
  private _toggleJoinAvailability;
@@ -7,6 +7,9 @@ import BaseTransport from './BaseTransport';
7
7
  export default class DirectTransport extends BaseTransport {
8
8
  private readonly _participantId;
9
9
  private readonly _isMaster;
10
+ private _hasOutboundVideoDebug;
11
+ private _hasInboundVideoDebug;
12
+ private _videoDebugBytes;
10
13
  private _remoteSDP;
11
14
  private _remoteCandidates;
12
15
  private _lastRemoteSDP;
@@ -67,6 +70,8 @@ export default class DirectTransport extends BaseTransport {
67
70
  private static _patchRemoteDescription;
68
71
  private _onReplacedTrack;
69
72
  private _startStatInterval;
73
+ private _reportVideoStreamDebug;
74
+ private _getVideoDebugBitrate;
70
75
  /**
71
76
  * Check SVC support
72
77
  * @see https://webrtc.internaut.com/mc/
@@ -5,6 +5,9 @@ import ServerSettings from '../../types/ServerSettings';
5
5
  import { MediaSource } from '../MediaSource';
6
6
  import BaseTransport from './BaseTransport';
7
7
  export default class ServerTransport extends BaseTransport {
8
+ private _hasOutboundVideoDebug;
9
+ private _inboundVideoDebugParticipants;
10
+ private _videoDebugBytes;
8
11
  private _producerNotification;
9
12
  private _producerCommand;
10
13
  private _producerScreen;
@@ -36,6 +39,7 @@ export default class ServerTransport extends BaseTransport {
36
39
  private _participantIdRegistry;
37
40
  private _disabledSenders;
38
41
  private _rtpReceiversByStreamId;
42
+ private _participantIdByVideoTrackId;
39
43
  private _producerSessionId;
40
44
  private _newAudioShareTrack;
41
45
  private _simulcastInfo;
@@ -74,6 +78,10 @@ export default class ServerTransport extends BaseTransport {
74
78
  private _stopSettingsInterval;
75
79
  private _collectStat;
76
80
  private _reportStats;
81
+ private _reportVideoStreamDebug;
82
+ private _getVideoDebugStreamId;
83
+ private _getVideoDebugTrackId;
84
+ private _getVideoDebugBitrate;
77
85
  private _detectStaleTracks;
78
86
  private _allocateConsumer;
79
87
  private _processOffer;
@@ -1,5 +1,6 @@
1
1
  import type { AnimojiSvgData, RGBTuple } from '@vkontakte/calls-vmoji';
2
2
  import BaseSignaling from '../../abstract/BaseSignaling';
3
+ import { VideoStreamDebugDirection } from '../../static/DebugVideoStats';
3
4
  import { ParticipantId } from '../../types/Participant';
4
5
  import ServerSettings from '../../types/ServerSettings';
5
6
  import EventEmitter from '../EventEmitter';
@@ -21,7 +22,8 @@ export declare const enum TransportEvent {
21
22
  ASR_TRANSCRIPTION = "ASR_TRANSCRIPTION",
22
23
  ANIMOJI_STREAM = "ANIMOJI_STREAM",
23
24
  ANIMOJI_ERROR = "ANIMOJI_ERROR",
24
- SCREEN_SHARING_STAT = "SCREEN_SHARING_STAT"
25
+ SCREEN_SHARING_STAT = "SCREEN_SHARING_STAT",
26
+ VIDEO_STREAM_DEBUG = "VIDEO_STREAM_DEBUG"
25
27
  }
26
28
  export declare const enum TransportState {
27
29
  IDLE = "IDLE",
@@ -36,6 +38,18 @@ export declare const enum TransportTopology {
36
38
  DIRECT = "DIRECT",
37
39
  SERVER = "SERVER"
38
40
  }
41
+ export type VideoStreamDebugEvent = {
42
+ direction: VideoStreamDebugDirection;
43
+ streamId?: ParticipantId;
44
+ trackId?: string;
45
+ mimeType?: string;
46
+ width?: number;
47
+ height?: number;
48
+ frameRate?: number;
49
+ bitrate?: number;
50
+ packetsLost?: number;
51
+ clear?: boolean;
52
+ };
39
53
  export declare class Transport extends EventEmitter {
40
54
  private readonly _signaling;
41
55
  private readonly _mediaSource;
@@ -85,6 +99,7 @@ export declare class Transport extends EventEmitter {
85
99
  private _onPeerConnectionClosed;
86
100
  private _onServerAudioMixStall;
87
101
  private _onRemoteDataStats;
102
+ private _onVideoStreamDebug;
88
103
  private _onRemoteTrackAdded;
89
104
  private _onRemoteTrackRemoved;
90
105
  private _onAsrTranscription;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.10",
3
+ "version": "2.8.11-dev.5500645b.0",
4
4
  "author": "vk.com",
5
5
  "description": "Library for video calls based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -0,0 +1,22 @@
1
+ import { ExternalParticipantId } from '../types/ExternalId';
2
+ export declare const enum VideoStreamDebugDirection {
3
+ INBOUND = "inbound",
4
+ OUTBOUND = "outbound"
5
+ }
6
+ export type VideoStreamDebugData = {
7
+ direction: VideoStreamDebugDirection;
8
+ externalParticipantId: ExternalParticipantId;
9
+ trackId?: string;
10
+ mimeType?: string;
11
+ width?: number;
12
+ height?: number;
13
+ frameRate?: number;
14
+ bitrate?: number;
15
+ packetsLost?: number;
16
+ };
17
+ declare namespace DebugVideoStats {
18
+ function format(data: VideoStreamDebugData): string;
19
+ function send(data: VideoStreamDebugData): void;
20
+ function clear(externalParticipantId: ExternalParticipantId): void;
21
+ }
22
+ export default DebugVideoStats;
@@ -563,5 +563,9 @@ declare namespace External {
563
563
  * Собеседник подключился к сигналлингу
564
564
  */
565
565
  function onPeerRegistered(): void;
566
+ /**
567
+ * Дебаг информация по видеопотоку, отформатированная SDK для отображения в клиенте.
568
+ */
569
+ function onVideoStreamDebug(externalParticipantId: ExternalParticipantId, debug: string): void;
566
570
  }
567
571
  export default External;
@@ -104,6 +104,13 @@ export type ParamsObject = {
104
104
  debugLog: boolean;
105
105
  /** @hidden */
106
106
  debug: boolean;
107
+ /**
108
+ * Вкчлючает отправку на клиент статы по входящим/исходящим видео-потокам
109
+ * @hidden
110
+ *
111
+ * _По умолчанию: `false`_
112
+ */
113
+ debugVideoStreams: boolean;
107
114
  /**
108
115
  * Выставляет таймаут в ms для fetch запросов от sdk
109
116
  * По умолчанию 5000 ms
@@ -863,6 +870,15 @@ export type ParamsObject = {
863
870
  * Собеседник подключился к сигналлингу
864
871
  */
865
872
  onPeerRegistered?: () => void;
873
+ /**
874
+ * Дебаг информация по видеопотоку, отформатированная SDK для отображения в клиенте.
875
+ *
876
+ * Работает только если включен `debugVideoStreams`.
877
+ *
878
+ * @param externalParticipantId Id участника, к которому относится видеопоток
879
+ * @param debug Отформатированный текст для отображения
880
+ */
881
+ onVideoStreamDebug?: (externalParticipantId: ExternalParticipantId, debug: string) => void;
866
882
  };
867
883
  export default abstract class Params {
868
884
  private static _params;
@@ -914,6 +930,7 @@ export default abstract class Params {
914
930
  static get waitMessageDelay(): number;
915
931
  static get waitAnotherTabDelay(): number;
916
932
  static get debugLog(): boolean;
933
+ static get debugVideoStreams(): false | ((externalParticipantId: ExternalParticipantId, debug: string) => void) | undefined;
917
934
  static get forceRelayPolicy(): boolean;
918
935
  static set forceRelayPolicy(value: boolean);
919
936
  static get videoMinWidth(): number;
@@ -113,6 +113,10 @@ export interface StatRtp extends StatRtpOutboundVideo {
113
113
  * Идентификатор пользователя, связанный с этим потоком
114
114
  */
115
115
  userId?: string;
116
+ /**
117
+ * Идентификатор media track, связанный с этим RTP потоком
118
+ */
119
+ trackId?: string;
116
120
  /**
117
121
  * Пропускная способность в битах в секунду
118
122
  */