@stream-io/video-client 1.4.3 → 1.4.5
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 +14 -0
- package/dist/index.browser.es.js +49 -12
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +49 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +49 -12
- 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/dist/src/gen/video/sfu/models/models.d.ts +9 -1
- package/package.json +1 -1
- package/src/client-details.ts +17 -2
- 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/src/gen/video/sfu/models/models.ts +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [1.4.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.4.4...@stream-io/video-client-1.4.5) (2024-07-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* report the Plain-JS sdk version to the SFU ([#1438](https://github.com/GetStream/stream-video-js/issues/1438)) ([7ac54e4](https://github.com/GetStream/stream-video-js/commit/7ac54e46c80288debbf99339e861fe7f6cdb0fdf))
|
|
11
|
+
|
|
12
|
+
### [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)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* refactor background filters ([#1415](https://github.com/GetStream/stream-video-js/issues/1415)) ([deb6da2](https://github.com/GetStream/stream-video-js/commit/deb6da238f541c733451e84b198434671da8dceb))
|
|
18
|
+
|
|
5
19
|
### [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
20
|
|
|
7
21
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -925,6 +925,14 @@ var SdkType;
|
|
|
925
925
|
* @generated from protobuf enum value: SDK_TYPE_UNITY = 7;
|
|
926
926
|
*/
|
|
927
927
|
SdkType[SdkType["UNITY"] = 7] = "UNITY";
|
|
928
|
+
/**
|
|
929
|
+
* @generated from protobuf enum value: SDK_TYPE_GO = 8;
|
|
930
|
+
*/
|
|
931
|
+
SdkType[SdkType["GO"] = 8] = "GO";
|
|
932
|
+
/**
|
|
933
|
+
* @generated from protobuf enum value: SDK_TYPE_PLAIN_JAVASCRIPT = 9;
|
|
934
|
+
*/
|
|
935
|
+
SdkType[SdkType["PLAIN_JAVASCRIPT"] = 9] = "PLAIN_JAVASCRIPT";
|
|
928
936
|
})(SdkType || (SdkType = {}));
|
|
929
937
|
/**
|
|
930
938
|
* @generated from protobuf enum stream.video.sfu.models.TrackUnpublishReason
|
|
@@ -6527,7 +6535,14 @@ function getIceCandidate(candidate) {
|
|
|
6527
6535
|
}
|
|
6528
6536
|
}
|
|
6529
6537
|
|
|
6530
|
-
|
|
6538
|
+
const version = "1.4.5" ;
|
|
6539
|
+
const [major, minor, patch] = version.split('.');
|
|
6540
|
+
let sdkInfo = {
|
|
6541
|
+
type: SdkType.PLAIN_JAVASCRIPT,
|
|
6542
|
+
major,
|
|
6543
|
+
minor,
|
|
6544
|
+
patch,
|
|
6545
|
+
};
|
|
6531
6546
|
let osInfo;
|
|
6532
6547
|
let deviceInfo;
|
|
6533
6548
|
let webRtcInfo;
|
|
@@ -11164,6 +11179,7 @@ class InputMediaDeviceManager {
|
|
|
11164
11179
|
this.isTrackStoppedDueToTrackEnd = false;
|
|
11165
11180
|
this.filters = [];
|
|
11166
11181
|
this.statusChangeConcurrencyTag = Symbol('statusChangeConcurrencyTag');
|
|
11182
|
+
this.filterRegistrationConcurrencyTag = Symbol('filterRegistrationConcurrencyTag');
|
|
11167
11183
|
/**
|
|
11168
11184
|
* Disposes the manager.
|
|
11169
11185
|
*
|
|
@@ -11266,14 +11282,24 @@ class InputMediaDeviceManager {
|
|
|
11266
11282
|
* a new stream with the applied filter.
|
|
11267
11283
|
*
|
|
11268
11284
|
* @param filter the filter to register.
|
|
11269
|
-
* @returns
|
|
11285
|
+
* @returns MediaStreamFilterRegistrationResult
|
|
11270
11286
|
*/
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11287
|
+
registerFilter(filter) {
|
|
11288
|
+
const entry = {
|
|
11289
|
+
start: filter,
|
|
11290
|
+
stop: undefined,
|
|
11291
|
+
};
|
|
11292
|
+
const registered = withoutConcurrency(this.filterRegistrationConcurrencyTag, async () => {
|
|
11293
|
+
this.filters.push(entry);
|
|
11276
11294
|
await this.applySettingsToStream();
|
|
11295
|
+
});
|
|
11296
|
+
return {
|
|
11297
|
+
registered,
|
|
11298
|
+
unregister: () => withoutConcurrency(this.filterRegistrationConcurrencyTag, async () => {
|
|
11299
|
+
entry.stop?.();
|
|
11300
|
+
this.filters = this.filters.filter((f) => f !== entry);
|
|
11301
|
+
await this.applySettingsToStream();
|
|
11302
|
+
}),
|
|
11277
11303
|
};
|
|
11278
11304
|
}
|
|
11279
11305
|
/**
|
|
@@ -11326,6 +11352,7 @@ class InputMediaDeviceManager {
|
|
|
11326
11352
|
this.state.mediaStream.release();
|
|
11327
11353
|
}
|
|
11328
11354
|
this.state.setMediaStream(undefined, undefined);
|
|
11355
|
+
this.filters.forEach((entry) => entry.stop?.());
|
|
11329
11356
|
}
|
|
11330
11357
|
}
|
|
11331
11358
|
muteTracks() {
|
|
@@ -11430,7 +11457,16 @@ class InputMediaDeviceManager {
|
|
|
11430
11457
|
// e.g. camera or microphone stream
|
|
11431
11458
|
rootStream = this.getStream(constraints);
|
|
11432
11459
|
// we publish the last MediaStream of the chain
|
|
11433
|
-
stream = await this.filters.reduce((parent,
|
|
11460
|
+
stream = await this.filters.reduce((parent, entry) => parent
|
|
11461
|
+
.then((inputStream) => {
|
|
11462
|
+
const { stop, output } = entry.start(inputStream);
|
|
11463
|
+
entry.stop = stop;
|
|
11464
|
+
return output;
|
|
11465
|
+
})
|
|
11466
|
+
.then(chainWith(parent), (error) => {
|
|
11467
|
+
this.logger('warn', 'Fitler failed to start and will be ignored', error);
|
|
11468
|
+
return parent;
|
|
11469
|
+
}), rootStream);
|
|
11434
11470
|
}
|
|
11435
11471
|
if (this.call.state.callingState === CallingState.JOINED) {
|
|
11436
11472
|
await this.publishStream(stream);
|
|
@@ -12035,7 +12071,9 @@ class MicrophoneManager extends InputMediaDeviceManager {
|
|
|
12035
12071
|
});
|
|
12036
12072
|
}
|
|
12037
12073
|
});
|
|
12038
|
-
|
|
12074
|
+
const registrationResult = this.registerFilter(noiseCancellation.toFilter());
|
|
12075
|
+
this.noiseCancellationRegistration = registrationResult.registered;
|
|
12076
|
+
this.uregisterNoiseCancellation = registrationResult.unregister;
|
|
12039
12077
|
await this.noiseCancellationRegistration;
|
|
12040
12078
|
// handles an edge case where a noise cancellation is enabled after
|
|
12041
12079
|
// the participant as joined the call -> we immediately enable NC
|
|
@@ -12061,8 +12099,7 @@ class MicrophoneManager extends InputMediaDeviceManager {
|
|
|
12061
12099
|
if (isReactNative()) {
|
|
12062
12100
|
throw new Error('Noise cancellation is not supported in React Native');
|
|
12063
12101
|
}
|
|
12064
|
-
await this.
|
|
12065
|
-
?.then((unregister) => unregister())
|
|
12102
|
+
await (this.uregisterNoiseCancellation?.() ?? Promise.resolve())
|
|
12066
12103
|
.then(() => this.noiseCancellation?.disable())
|
|
12067
12104
|
.then(() => this.noiseCancellationChangeUnsubscribe?.())
|
|
12068
12105
|
.catch((err) => {
|
|
@@ -15484,7 +15521,7 @@ class StreamClient {
|
|
|
15484
15521
|
});
|
|
15485
15522
|
};
|
|
15486
15523
|
this.getUserAgent = () => {
|
|
15487
|
-
const version = "1.4.
|
|
15524
|
+
const version = "1.4.5" ;
|
|
15488
15525
|
return (this.userAgent ||
|
|
15489
15526
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
15490
15527
|
};
|