@stream-io/video-client 1.4.3 → 1.4.4
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 +7 -0
- package/dist/index.browser.es.js +33 -11
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +33 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +33 -11
- package/dist/index.es.js.map +1 -1
- package/dist/src/devices/InputMediaDeviceManager.d.ts +4 -3
- package/dist/src/devices/MicrophoneManager.d.ts +1 -0
- package/dist/src/devices/filters.d.ts +32 -0
- package/package.json +1 -1
- package/src/devices/InputMediaDeviceManager.ts +55 -12
- package/src/devices/MicrophoneManager.ts +6 -4
- package/src/devices/__tests__/InputMediaDeviceManagerFilters.test.ts +7 -6
- package/src/devices/filters.ts +38 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [1.4.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.4.3...@stream-io/video-client-1.4.4) (2024-07-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* refactor background filters ([#1415](https://github.com/GetStream/stream-video-js/issues/1415)) ([deb6da2](https://github.com/GetStream/stream-video-js/commit/deb6da238f541c733451e84b198434671da8dceb))
|
|
11
|
+
|
|
5
12
|
### [1.4.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.4.2...@stream-io/video-client-1.4.3) (2024-06-25)
|
|
6
13
|
|
|
7
14
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -11164,6 +11164,7 @@ class InputMediaDeviceManager {
|
|
|
11164
11164
|
this.isTrackStoppedDueToTrackEnd = false;
|
|
11165
11165
|
this.filters = [];
|
|
11166
11166
|
this.statusChangeConcurrencyTag = Symbol('statusChangeConcurrencyTag');
|
|
11167
|
+
this.filterRegistrationConcurrencyTag = Symbol('filterRegistrationConcurrencyTag');
|
|
11167
11168
|
/**
|
|
11168
11169
|
* Disposes the manager.
|
|
11169
11170
|
*
|
|
@@ -11266,14 +11267,24 @@ class InputMediaDeviceManager {
|
|
|
11266
11267
|
* a new stream with the applied filter.
|
|
11267
11268
|
*
|
|
11268
11269
|
* @param filter the filter to register.
|
|
11269
|
-
* @returns
|
|
11270
|
+
* @returns MediaStreamFilterRegistrationResult
|
|
11270
11271
|
*/
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11272
|
+
registerFilter(filter) {
|
|
11273
|
+
const entry = {
|
|
11274
|
+
start: filter,
|
|
11275
|
+
stop: undefined,
|
|
11276
|
+
};
|
|
11277
|
+
const registered = withoutConcurrency(this.filterRegistrationConcurrencyTag, async () => {
|
|
11278
|
+
this.filters.push(entry);
|
|
11276
11279
|
await this.applySettingsToStream();
|
|
11280
|
+
});
|
|
11281
|
+
return {
|
|
11282
|
+
registered,
|
|
11283
|
+
unregister: () => withoutConcurrency(this.filterRegistrationConcurrencyTag, async () => {
|
|
11284
|
+
entry.stop?.();
|
|
11285
|
+
this.filters = this.filters.filter((f) => f !== entry);
|
|
11286
|
+
await this.applySettingsToStream();
|
|
11287
|
+
}),
|
|
11277
11288
|
};
|
|
11278
11289
|
}
|
|
11279
11290
|
/**
|
|
@@ -11326,6 +11337,7 @@ class InputMediaDeviceManager {
|
|
|
11326
11337
|
this.state.mediaStream.release();
|
|
11327
11338
|
}
|
|
11328
11339
|
this.state.setMediaStream(undefined, undefined);
|
|
11340
|
+
this.filters.forEach((entry) => entry.stop?.());
|
|
11329
11341
|
}
|
|
11330
11342
|
}
|
|
11331
11343
|
muteTracks() {
|
|
@@ -11430,7 +11442,16 @@ class InputMediaDeviceManager {
|
|
|
11430
11442
|
// e.g. camera or microphone stream
|
|
11431
11443
|
rootStream = this.getStream(constraints);
|
|
11432
11444
|
// we publish the last MediaStream of the chain
|
|
11433
|
-
stream = await this.filters.reduce((parent,
|
|
11445
|
+
stream = await this.filters.reduce((parent, entry) => parent
|
|
11446
|
+
.then((inputStream) => {
|
|
11447
|
+
const { stop, output } = entry.start(inputStream);
|
|
11448
|
+
entry.stop = stop;
|
|
11449
|
+
return output;
|
|
11450
|
+
})
|
|
11451
|
+
.then(chainWith(parent), (error) => {
|
|
11452
|
+
this.logger('warn', 'Fitler failed to start and will be ignored', error);
|
|
11453
|
+
return parent;
|
|
11454
|
+
}), rootStream);
|
|
11434
11455
|
}
|
|
11435
11456
|
if (this.call.state.callingState === CallingState.JOINED) {
|
|
11436
11457
|
await this.publishStream(stream);
|
|
@@ -12035,7 +12056,9 @@ class MicrophoneManager extends InputMediaDeviceManager {
|
|
|
12035
12056
|
});
|
|
12036
12057
|
}
|
|
12037
12058
|
});
|
|
12038
|
-
|
|
12059
|
+
const registrationResult = this.registerFilter(noiseCancellation.toFilter());
|
|
12060
|
+
this.noiseCancellationRegistration = registrationResult.registered;
|
|
12061
|
+
this.uregisterNoiseCancellation = registrationResult.unregister;
|
|
12039
12062
|
await this.noiseCancellationRegistration;
|
|
12040
12063
|
// handles an edge case where a noise cancellation is enabled after
|
|
12041
12064
|
// the participant as joined the call -> we immediately enable NC
|
|
@@ -12061,8 +12084,7 @@ class MicrophoneManager extends InputMediaDeviceManager {
|
|
|
12061
12084
|
if (isReactNative()) {
|
|
12062
12085
|
throw new Error('Noise cancellation is not supported in React Native');
|
|
12063
12086
|
}
|
|
12064
|
-
await this.
|
|
12065
|
-
?.then((unregister) => unregister())
|
|
12087
|
+
await (this.uregisterNoiseCancellation?.() ?? Promise.resolve())
|
|
12066
12088
|
.then(() => this.noiseCancellation?.disable())
|
|
12067
12089
|
.then(() => this.noiseCancellationChangeUnsubscribe?.())
|
|
12068
12090
|
.catch((err) => {
|
|
@@ -15484,7 +15506,7 @@ class StreamClient {
|
|
|
15484
15506
|
});
|
|
15485
15507
|
};
|
|
15486
15508
|
this.getUserAgent = () => {
|
|
15487
|
-
const version = "1.4.
|
|
15509
|
+
const version = "1.4.4" ;
|
|
15488
15510
|
return (this.userAgent ||
|
|
15489
15511
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
15490
15512
|
};
|