sip-connector 15.2.0 → 15.3.1

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.
package/README.md CHANGED
@@ -10,6 +10,7 @@ TypeScript SDK для подключения к Vinteo по WebRTC через SI
10
10
  - управления презентацией (share screen/video);
11
11
  - отправки служебных сообщений (DTMF, каналы, синхронизация медиа-состояния);
12
12
  - подписки на события платформы.
13
+ - сбора и подписки на WebRTC‑статистику (outbound/inbound RTP, битрейты и др.).
13
14
 
14
15
  ## Установка
15
16
 
@@ -58,8 +59,15 @@ const pc = await facade.callToServer({
58
59
  },
59
60
  });
60
61
 
62
+ // (опционально) Подписка на WebRTC‑статистику
63
+ const unsubscribeStats = facade.onStats(({ outbound, inbound }) => {
64
+ console.log('stats outbound', outbound);
65
+ console.log('stats inbound', inbound);
66
+ });
67
+
61
68
  // 5) Завершение
62
69
  await facade.disconnectFromServer();
70
+ unsubscribeStats();
63
71
  ```
64
72
 
65
73
  ## Входящий звонок (пример)
@@ -105,6 +113,7 @@ await facade.stopShareSipConnector();
105
113
 
106
114
  - `src/SipConnector/eventNames.ts`
107
115
  - `src/ApiManager/eventNames.ts`
116
+ - `src/StatsManager/eventNames.ts`
108
117
 
109
118
  Примеры часто используемых событий:
110
119
 
@@ -113,6 +122,7 @@ await facade.stopShareSipConnector();
113
122
  - `api:enterRoom`, `api:useLicense`, `api:mustStopPresentation`, `api:newDTMF` — события от сервера;
114
123
  - `incoming-call:incoming`, `incoming-call:failed` — входящие вызовы;
115
124
  - `presentation:started`, `presentation:stopped` — презентация.
125
+ - `stats:collected` — собранная WebRTC‑статистика.
116
126
 
117
127
  Подписка:
118
128
 
@@ -140,6 +150,9 @@ import {
140
150
  hasCanceledCallError,
141
151
  EUseLicense,
142
152
  EMimeTypesVideoCodecs,
153
+ EStatsTypes,
154
+ StatsPeerConnection,
155
+ hasAvailableStats,
143
156
  type TContentHint,
144
157
  type TCustomError,
145
158
  type TJsSIP,
@@ -152,6 +165,7 @@ import {
152
165
  - `SipConnector` — низкоуровневый класс, инкапсулирующий менеджеры подключения/звонков/презентаций. Требует `JsSIP` при создании.
153
166
  - `SipConnectorFacade` — удобный фасад с готовыми сценариями: `connectToServer`, `callToServer`, `answerToIncomingCall`, `disconnectFromServer`, `replaceMediaStream`, `sendMediaState`, `sendRefusalToTurnOnMic/Cam`, `onUseLicense`, `onMustStopPresentation`, `onMoveToSpectators/Participants` и др. Также проксирует методы `on/once/onceRace/wait/off`, `ping`, `hangUp`, `sendDTMF`, `checkTelephony`, `connection`, `isConfigured`, `isRegistered`.
154
167
  - Поддерживаются настройки качества: `contentHint`, `degradationPreference`, `simulcastEncodings`, `sendEncodings`, фильтрация кодеков видео через `preferredMimeTypesVideoCodecs`/`excludeMimeTypesVideoCodecs`.
168
+ - Статистика: подписка `facade.onStats(handler)` и отписка `facade.offStats(handler)`. Также доступны низкоуровневые инструменты: `StatsPeerConnection`, `EStatsTypes`, `hasAvailableStats`.
155
169
 
156
170
  ## Отладка
157
171