@stream-io/video-client 1.10.0 → 1.10.2
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 +24 -12
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +23 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +24 -12
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/devices/BrowserPermission.ts +3 -1
- package/src/devices/InputMediaDeviceManager.ts +3 -3
- package/src/devices/__tests__/InputMediaDeviceManager.test.ts +23 -0
- package/src/devices/devices.ts +19 -6
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.10.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.10.1...@stream-io/video-client-1.10.2) (2024-11-01)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* camera not enabled on foreground notifications ([#1546](https://github.com/GetStream/stream-video-js/issues/1546)) ([67c920a](https://github.com/GetStream/stream-video-js/commit/67c920ac4bca35a414b88f6c9829b08396a6260b))
|
|
11
|
+
|
|
12
|
+
## [1.10.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.10.0...@stream-io/video-client-1.10.1) (2024-10-30)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* various device selector issues ([#1541](https://github.com/GetStream/stream-video-js/issues/1541)) ([f23618b](https://github.com/GetStream/stream-video-js/commit/f23618bda447eeb2d66f908bdb38b24db051f87c))
|
|
18
|
+
|
|
5
19
|
## [1.10.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.9.3...@stream-io/video-client-1.10.0) (2024-10-30)
|
|
6
20
|
|
|
7
21
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -5,7 +5,7 @@ import axios, { AxiosHeaders } from 'axios';
|
|
|
5
5
|
export { AxiosError } from 'axios';
|
|
6
6
|
import { TwirpFetchTransport, TwirpErrorCode } from '@protobuf-ts/twirp-transport';
|
|
7
7
|
import { UAParser } from 'ua-parser-js';
|
|
8
|
-
import { ReplaySubject, combineLatest, BehaviorSubject, map as map$1, shareReplay, distinctUntilChanged, takeWhile, distinctUntilKeyChanged, fromEventPattern, startWith, concatMap,
|
|
8
|
+
import { ReplaySubject, combineLatest, BehaviorSubject, map as map$1, shareReplay, distinctUntilChanged, takeWhile, distinctUntilKeyChanged, fromEventPattern, startWith, concatMap, from, fromEvent, debounceTime, merge, pairwise, of } from 'rxjs';
|
|
9
9
|
import * as SDP from 'sdp-transform';
|
|
10
10
|
import WebSocket$1 from 'isomorphic-ws';
|
|
11
11
|
import { fromByteArray } from 'base64-js';
|
|
@@ -3108,7 +3108,7 @@ const retryable = async (rpc, signal) => {
|
|
|
3108
3108
|
return result;
|
|
3109
3109
|
};
|
|
3110
3110
|
|
|
3111
|
-
const version = "1.10.
|
|
3111
|
+
const version = "1.10.2";
|
|
3112
3112
|
const [major, minor, patch] = version.split('.');
|
|
3113
3113
|
let sdkInfo = {
|
|
3114
3114
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -7830,7 +7830,7 @@ class BrowserPermission {
|
|
|
7830
7830
|
const signal = this.disposeController.signal;
|
|
7831
7831
|
this.ready = (async () => {
|
|
7832
7832
|
const assumeGranted = (error) => {
|
|
7833
|
-
this.setState('
|
|
7833
|
+
this.setState('prompt');
|
|
7834
7834
|
};
|
|
7835
7835
|
if (!canQueryPermissions()) {
|
|
7836
7836
|
return assumeGranted();
|
|
@@ -7876,6 +7876,7 @@ class BrowserPermission {
|
|
|
7876
7876
|
this.wasPrompted = true;
|
|
7877
7877
|
const stream = await navigator.mediaDevices.getUserMedia(this.permission.constraints);
|
|
7878
7878
|
disposeOfMediaStream(stream);
|
|
7879
|
+
this.setState('granted');
|
|
7879
7880
|
return true;
|
|
7880
7881
|
}
|
|
7881
7882
|
catch (e) {
|
|
@@ -7883,6 +7884,7 @@ class BrowserPermission {
|
|
|
7883
7884
|
this.logger('info', 'Browser permission was not granted', {
|
|
7884
7885
|
permission: this.permission,
|
|
7885
7886
|
});
|
|
7887
|
+
this.setState('denied');
|
|
7886
7888
|
if (throwOnNotAllowed) {
|
|
7887
7889
|
throw e;
|
|
7888
7890
|
}
|
|
@@ -7954,7 +7956,9 @@ const getDevices = (permission, kind) => {
|
|
|
7954
7956
|
await permission.prompt({ throwOnNotAllowed: true });
|
|
7955
7957
|
devices = await navigator.mediaDevices.enumerateDevices();
|
|
7956
7958
|
}
|
|
7957
|
-
return devices.filter((
|
|
7959
|
+
return devices.filter((device) => device.kind === kind &&
|
|
7960
|
+
device.label !== '' &&
|
|
7961
|
+
device.deviceId !== 'default');
|
|
7958
7962
|
})());
|
|
7959
7963
|
};
|
|
7960
7964
|
/**
|
|
@@ -8024,20 +8028,27 @@ const getAudioDevices = lazy(() => {
|
|
|
8024
8028
|
* if devices are added/removed the list is updated, and if the permission is revoked,
|
|
8025
8029
|
* the observable errors.
|
|
8026
8030
|
*/
|
|
8027
|
-
const getVideoDevices = () => {
|
|
8031
|
+
const getVideoDevices = lazy(() => {
|
|
8028
8032
|
return merge(getDeviceChangeObserver(), getVideoBrowserPermission().asObservable()).pipe(startWith(undefined), concatMap(() => getDevices(getVideoBrowserPermission(), 'videoinput')), shareReplay(1));
|
|
8029
|
-
};
|
|
8033
|
+
});
|
|
8030
8034
|
/**
|
|
8031
8035
|
* Prompts the user for a permission to use video devices (if not already granted
|
|
8032
8036
|
* and was not prompted before) and lists the available 'audiooutput' devices,
|
|
8033
8037
|
* if devices are added/removed the list is updated, and if the permission is revoked,
|
|
8034
8038
|
* the observable errors.
|
|
8035
8039
|
*/
|
|
8036
|
-
const getAudioOutputDevices = () => {
|
|
8040
|
+
const getAudioOutputDevices = lazy(() => {
|
|
8037
8041
|
return merge(getDeviceChangeObserver(), getAudioBrowserPermission().asObservable()).pipe(startWith(undefined), concatMap(() => getDevices(getAudioBrowserPermission(), 'audiooutput')), shareReplay(1));
|
|
8038
|
-
};
|
|
8042
|
+
});
|
|
8039
8043
|
const getStream = async (constraints) => {
|
|
8040
|
-
|
|
8044
|
+
const stream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
8045
|
+
if (isFirefox()) {
|
|
8046
|
+
// When enumerating devices, Firefox will hide device labels unless there's been
|
|
8047
|
+
// an active user media stream on the page. So we force device list updates after
|
|
8048
|
+
// every successful getUserMedia call.
|
|
8049
|
+
navigator.mediaDevices.dispatchEvent(new Event('devicechange'));
|
|
8050
|
+
}
|
|
8051
|
+
return stream;
|
|
8041
8052
|
};
|
|
8042
8053
|
/**
|
|
8043
8054
|
* Returns an audio media stream that fulfills the given constraints.
|
|
@@ -8213,6 +8224,7 @@ class InputMediaDeviceManager {
|
|
|
8213
8224
|
* Starts stream.
|
|
8214
8225
|
*/
|
|
8215
8226
|
async enable() {
|
|
8227
|
+
this.state.prevStatus = this.state.optimisticStatus;
|
|
8216
8228
|
if (this.state.optimisticStatus === 'enabled') {
|
|
8217
8229
|
return;
|
|
8218
8230
|
}
|
|
@@ -8234,7 +8246,7 @@ class InputMediaDeviceManager {
|
|
|
8234
8246
|
* @param {boolean} [forceStop=false] when true, stops the tracks regardless of the state.disableMode
|
|
8235
8247
|
*/
|
|
8236
8248
|
async disable(forceStop = false) {
|
|
8237
|
-
this.state.prevStatus = this.state.
|
|
8249
|
+
this.state.prevStatus = this.state.optimisticStatus;
|
|
8238
8250
|
if (!forceStop && this.state.optimisticStatus === 'disabled') {
|
|
8239
8251
|
return;
|
|
8240
8252
|
}
|
|
@@ -8263,7 +8275,7 @@ class InputMediaDeviceManager {
|
|
|
8263
8275
|
*/
|
|
8264
8276
|
async resume() {
|
|
8265
8277
|
if (this.state.prevStatus === 'enabled' &&
|
|
8266
|
-
this.state.status
|
|
8278
|
+
this.state.status !== 'enabled') {
|
|
8267
8279
|
await this.enable();
|
|
8268
8280
|
}
|
|
8269
8281
|
}
|
|
@@ -12684,7 +12696,7 @@ class StreamClient {
|
|
|
12684
12696
|
});
|
|
12685
12697
|
};
|
|
12686
12698
|
this.getUserAgent = () => {
|
|
12687
|
-
const version = "1.10.
|
|
12699
|
+
const version = "1.10.2";
|
|
12688
12700
|
return (this.userAgent ||
|
|
12689
12701
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
12690
12702
|
};
|