@stream-io/video-client 1.23.4 → 1.24.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.
- package/CHANGELOG.md +17 -0
- package/dist/index.browser.es.js +136 -13
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +137 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +136 -13
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +9 -2
- package/dist/src/gen/coordinator/index.d.ts +407 -117
- package/dist/src/gen/shims.d.ts +4 -2
- package/dist/src/stats/types.d.ts +25 -0
- package/dist/src/store/CallState.d.ts +5 -0
- package/package.json +1 -1
- package/src/Call.ts +20 -7
- package/src/devices/BrowserPermission.ts +5 -1
- package/src/gen/coordinator/index.ts +398 -117
- package/src/gen/shims.ts +1 -3
- package/src/stats/CallStateStatsReporter.ts +7 -3
- package/src/stats/types.ts +25 -0
- package/src/store/CallState.ts +11 -0
package/dist/index.cjs.js
CHANGED
|
@@ -174,6 +174,90 @@ const RecordSettingsRequestQualityEnum = {
|
|
|
174
174
|
PORTRAIT_1440X2560: 'portrait-1440x2560',
|
|
175
175
|
PORTRAIT_2160X3840: 'portrait-2160x3840',
|
|
176
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* @export
|
|
179
|
+
*/
|
|
180
|
+
const StartClosedCaptionsRequestLanguageEnum = {
|
|
181
|
+
AUTO: 'auto',
|
|
182
|
+
EN: 'en',
|
|
183
|
+
FR: 'fr',
|
|
184
|
+
ES: 'es',
|
|
185
|
+
DE: 'de',
|
|
186
|
+
IT: 'it',
|
|
187
|
+
NL: 'nl',
|
|
188
|
+
PT: 'pt',
|
|
189
|
+
PL: 'pl',
|
|
190
|
+
CA: 'ca',
|
|
191
|
+
CS: 'cs',
|
|
192
|
+
DA: 'da',
|
|
193
|
+
EL: 'el',
|
|
194
|
+
FI: 'fi',
|
|
195
|
+
ID: 'id',
|
|
196
|
+
JA: 'ja',
|
|
197
|
+
RU: 'ru',
|
|
198
|
+
SV: 'sv',
|
|
199
|
+
TA: 'ta',
|
|
200
|
+
TH: 'th',
|
|
201
|
+
TR: 'tr',
|
|
202
|
+
HU: 'hu',
|
|
203
|
+
RO: 'ro',
|
|
204
|
+
ZH: 'zh',
|
|
205
|
+
AR: 'ar',
|
|
206
|
+
TL: 'tl',
|
|
207
|
+
HE: 'he',
|
|
208
|
+
HI: 'hi',
|
|
209
|
+
HR: 'hr',
|
|
210
|
+
KO: 'ko',
|
|
211
|
+
MS: 'ms',
|
|
212
|
+
NO: 'no',
|
|
213
|
+
UK: 'uk',
|
|
214
|
+
BG: 'bg',
|
|
215
|
+
ET: 'et',
|
|
216
|
+
SL: 'sl',
|
|
217
|
+
SK: 'sk',
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* @export
|
|
221
|
+
*/
|
|
222
|
+
const StartTranscriptionRequestLanguageEnum = {
|
|
223
|
+
AUTO: 'auto',
|
|
224
|
+
EN: 'en',
|
|
225
|
+
FR: 'fr',
|
|
226
|
+
ES: 'es',
|
|
227
|
+
DE: 'de',
|
|
228
|
+
IT: 'it',
|
|
229
|
+
NL: 'nl',
|
|
230
|
+
PT: 'pt',
|
|
231
|
+
PL: 'pl',
|
|
232
|
+
CA: 'ca',
|
|
233
|
+
CS: 'cs',
|
|
234
|
+
DA: 'da',
|
|
235
|
+
EL: 'el',
|
|
236
|
+
FI: 'fi',
|
|
237
|
+
ID: 'id',
|
|
238
|
+
JA: 'ja',
|
|
239
|
+
RU: 'ru',
|
|
240
|
+
SV: 'sv',
|
|
241
|
+
TA: 'ta',
|
|
242
|
+
TH: 'th',
|
|
243
|
+
TR: 'tr',
|
|
244
|
+
HU: 'hu',
|
|
245
|
+
RO: 'ro',
|
|
246
|
+
ZH: 'zh',
|
|
247
|
+
AR: 'ar',
|
|
248
|
+
TL: 'tl',
|
|
249
|
+
HE: 'he',
|
|
250
|
+
HI: 'hi',
|
|
251
|
+
HR: 'hr',
|
|
252
|
+
KO: 'ko',
|
|
253
|
+
MS: 'ms',
|
|
254
|
+
NO: 'no',
|
|
255
|
+
UK: 'uk',
|
|
256
|
+
BG: 'bg',
|
|
257
|
+
ET: 'et',
|
|
258
|
+
SL: 'sl',
|
|
259
|
+
SK: 'sk',
|
|
260
|
+
};
|
|
177
261
|
/**
|
|
178
262
|
* @export
|
|
179
263
|
*/
|
|
@@ -219,6 +303,10 @@ const TranscriptionSettingsRequestLanguageEnum = {
|
|
|
219
303
|
MS: 'ms',
|
|
220
304
|
NO: 'no',
|
|
221
305
|
UK: 'uk',
|
|
306
|
+
BG: 'bg',
|
|
307
|
+
ET: 'et',
|
|
308
|
+
SL: 'sl',
|
|
309
|
+
SK: 'sk',
|
|
222
310
|
};
|
|
223
311
|
/**
|
|
224
312
|
* @export
|
|
@@ -273,6 +361,10 @@ const TranscriptionSettingsResponseLanguageEnum = {
|
|
|
273
361
|
MS: 'ms',
|
|
274
362
|
NO: 'no',
|
|
275
363
|
UK: 'uk',
|
|
364
|
+
BG: 'bg',
|
|
365
|
+
ET: 'et',
|
|
366
|
+
SL: 'sl',
|
|
367
|
+
SK: 'sk',
|
|
276
368
|
};
|
|
277
369
|
/**
|
|
278
370
|
* @export
|
|
@@ -5096,11 +5188,14 @@ class CallState {
|
|
|
5096
5188
|
this.eventHandlers = {
|
|
5097
5189
|
// these events are not updating the call state:
|
|
5098
5190
|
'call.frame_recording_ready': undefined,
|
|
5191
|
+
'call.moderation_blur': undefined,
|
|
5192
|
+
'call.moderation_warning': undefined,
|
|
5099
5193
|
'call.permission_request': undefined,
|
|
5100
5194
|
'call.recording_ready': undefined,
|
|
5101
5195
|
'call.rtmp_broadcast_failed': undefined,
|
|
5102
5196
|
'call.rtmp_broadcast_started': undefined,
|
|
5103
5197
|
'call.rtmp_broadcast_stopped': undefined,
|
|
5198
|
+
'call.stats_report_ready': undefined,
|
|
5104
5199
|
'call.transcription_ready': undefined,
|
|
5105
5200
|
'call.user_muted': undefined,
|
|
5106
5201
|
'connection.error': undefined,
|
|
@@ -5257,6 +5352,13 @@ class CallState {
|
|
|
5257
5352
|
get callStatsReport() {
|
|
5258
5353
|
return this.getCurrentValue(this.callStatsReport$);
|
|
5259
5354
|
}
|
|
5355
|
+
/**
|
|
5356
|
+
* Returns whether the call stats report is being observed or not.
|
|
5357
|
+
* @internal
|
|
5358
|
+
*/
|
|
5359
|
+
get isCallStatsReportObserved() {
|
|
5360
|
+
return this.callStatsReportSubject.observed;
|
|
5361
|
+
}
|
|
5260
5362
|
/**
|
|
5261
5363
|
* The members of the current call.
|
|
5262
5364
|
*/
|
|
@@ -5543,9 +5645,13 @@ const createStatsReporter = ({ subscriber, publisher, state, datacenter, polling
|
|
|
5543
5645
|
let timeoutId;
|
|
5544
5646
|
if (pollingIntervalInMs > 0) {
|
|
5545
5647
|
const loop = async () => {
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5648
|
+
// bail out of the loop as we don't want to collect stats
|
|
5649
|
+
// (they are expensive) if no one is listening to them
|
|
5650
|
+
if (state.isCallStatsReportObserved) {
|
|
5651
|
+
await run().catch((e) => {
|
|
5652
|
+
logger('debug', 'Failed to collect stats', e);
|
|
5653
|
+
});
|
|
5654
|
+
}
|
|
5549
5655
|
timeoutId = setTimeout(loop, pollingIntervalInMs);
|
|
5550
5656
|
};
|
|
5551
5657
|
void loop();
|
|
@@ -5687,7 +5793,7 @@ const aggregate = (stats) => {
|
|
|
5687
5793
|
return report;
|
|
5688
5794
|
};
|
|
5689
5795
|
|
|
5690
|
-
const version = "1.
|
|
5796
|
+
const version = "1.24.0";
|
|
5691
5797
|
const [major, minor, patch] = version.split('.');
|
|
5692
5798
|
let sdkInfo = {
|
|
5693
5799
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -9027,7 +9133,12 @@ class BrowserPermission {
|
|
|
9027
9133
|
const signal = this.disposeController.signal;
|
|
9028
9134
|
this.ready = (async () => {
|
|
9029
9135
|
const assumeGranted = () => {
|
|
9030
|
-
|
|
9136
|
+
if (isReactNative()) {
|
|
9137
|
+
this.setState('granted');
|
|
9138
|
+
}
|
|
9139
|
+
else {
|
|
9140
|
+
this.setState('prompt');
|
|
9141
|
+
}
|
|
9031
9142
|
};
|
|
9032
9143
|
if (!canQueryPermissions()) {
|
|
9033
9144
|
return assumeGranted();
|
|
@@ -10910,6 +11021,7 @@ class Call {
|
|
|
10910
11021
|
* @private
|
|
10911
11022
|
*/
|
|
10912
11023
|
this.dispatcher = new Dispatcher();
|
|
11024
|
+
this.statsReportingIntervalInMs = 2000;
|
|
10913
11025
|
this.sfuClientTag = 0;
|
|
10914
11026
|
this.reconnectConcurrencyTag = Symbol('reconnectConcurrencyTag');
|
|
10915
11027
|
this.reconnectAttempts = 0;
|
|
@@ -11636,12 +11748,15 @@ class Call {
|
|
|
11636
11748
|
});
|
|
11637
11749
|
}
|
|
11638
11750
|
this.statsReporter?.stop();
|
|
11639
|
-
this.
|
|
11640
|
-
|
|
11641
|
-
|
|
11642
|
-
|
|
11643
|
-
|
|
11644
|
-
|
|
11751
|
+
if (this.statsReportingIntervalInMs > 0) {
|
|
11752
|
+
this.statsReporter = createStatsReporter({
|
|
11753
|
+
subscriber: this.subscriber,
|
|
11754
|
+
publisher: this.publisher,
|
|
11755
|
+
state: this.state,
|
|
11756
|
+
datacenter: sfuClient.edgeName,
|
|
11757
|
+
pollingIntervalInMs: this.statsReportingIntervalInMs,
|
|
11758
|
+
});
|
|
11759
|
+
}
|
|
11645
11760
|
this.tracer.setEnabled(enableTracing);
|
|
11646
11761
|
this.sfuStatsReporter?.stop();
|
|
11647
11762
|
if (statsOptions?.reporting_interval_ms > 0) {
|
|
@@ -12131,6 +12246,14 @@ class Call {
|
|
|
12131
12246
|
this.stopReportingStatsFor = (sessionId) => {
|
|
12132
12247
|
return this.statsReporter?.stopReportingStatsFor(sessionId);
|
|
12133
12248
|
};
|
|
12249
|
+
/**
|
|
12250
|
+
* Sets the frequency of the call stats reporting.
|
|
12251
|
+
*
|
|
12252
|
+
* @param intervalInMs the interval in milliseconds to report the stats.
|
|
12253
|
+
*/
|
|
12254
|
+
this.setStatsReportingIntervalInMs = (intervalInMs) => {
|
|
12255
|
+
this.statsReportingIntervalInMs = intervalInMs;
|
|
12256
|
+
};
|
|
12134
12257
|
/**
|
|
12135
12258
|
* Resets the last sent reaction for the user holding the given `sessionId`. This is a local action, it won't reset the reaction on the backend.
|
|
12136
12259
|
*
|
|
@@ -13894,7 +14017,7 @@ class StreamClient {
|
|
|
13894
14017
|
this.getUserAgent = () => {
|
|
13895
14018
|
if (!this.cachedUserAgent) {
|
|
13896
14019
|
const { clientAppIdentifier = {} } = this.options;
|
|
13897
|
-
const { sdkName = 'js', sdkVersion = "1.
|
|
14020
|
+
const { sdkName = 'js', sdkVersion = "1.24.0", ...extras } = clientAppIdentifier;
|
|
13898
14021
|
this.cachedUserAgent = [
|
|
13899
14022
|
`stream-video-${sdkName}-v${sdkVersion}`,
|
|
13900
14023
|
...Object.entries(extras).map(([key, value]) => `${key}=${value}`),
|
|
@@ -14480,6 +14603,8 @@ exports.SfuEvents = events;
|
|
|
14480
14603
|
exports.SfuModels = models;
|
|
14481
14604
|
exports.SpeakerManager = SpeakerManager;
|
|
14482
14605
|
exports.SpeakerState = SpeakerState;
|
|
14606
|
+
exports.StartClosedCaptionsRequestLanguageEnum = StartClosedCaptionsRequestLanguageEnum;
|
|
14607
|
+
exports.StartTranscriptionRequestLanguageEnum = StartTranscriptionRequestLanguageEnum;
|
|
14483
14608
|
exports.StreamSfuClient = StreamSfuClient;
|
|
14484
14609
|
exports.StreamVideoClient = StreamVideoClient;
|
|
14485
14610
|
exports.StreamVideoReadOnlyStateStore = StreamVideoReadOnlyStateStore;
|