@stream-io/video-client 0.4.3 → 0.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 +37 -44
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +37 -44
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +37 -44
- package/dist/index.es.js.map +1 -1
- package/dist/src/devices/CameraManager.d.ts +18 -2
- package/package.json +2 -2
- package/src/Call.ts +9 -11
- package/src/devices/CameraManager.ts +32 -8
- package/src/devices/__tests__/CameraManager.test.ts +17 -0
- package/src/helpers/DynascaleManager.ts +9 -0
- package/src/rtc/flows/join.ts +0 -33
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
|
+
### [0.4.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.4.4...@stream-io/video-client-0.4.5) (2023-11-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* lift the debug helpers from the SDK to Pronto ([#1182](https://github.com/GetStream/stream-video-js/issues/1182)) ([8f31efc](https://github.com/GetStream/stream-video-js/commit/8f31efc71d9f85ef147d21b42f23876599c36072))
|
|
11
|
+
|
|
12
|
+
### [0.4.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.4.3...@stream-io/video-client-0.4.4) (2023-11-02)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* allow audio and screen share audio tracks, delay setSinkId ([#1176](https://github.com/GetStream/stream-video-js/issues/1176)) ([6a099c5](https://github.com/GetStream/stream-video-js/commit/6a099c5c7cc6f5d389961a7c594e914e19be4ddb))
|
|
18
|
+
|
|
5
19
|
### [0.4.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.4.2...@stream-io/video-client-0.4.3) (2023-11-01)
|
|
6
20
|
|
|
7
21
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -9137,19 +9137,6 @@ const doJoin = async (httpClient, type, id, data) => {
|
|
|
9137
9137
|
...data,
|
|
9138
9138
|
location,
|
|
9139
9139
|
};
|
|
9140
|
-
// FIXME OL: remove this once cascading is enabled by default
|
|
9141
|
-
const cascadingModeParams = getCascadingModeParams();
|
|
9142
|
-
if (cascadingModeParams) {
|
|
9143
|
-
// FIXME OL: remove after SFU migration is done
|
|
9144
|
-
if (data?.migrating_from && cascadingModeParams['next_sfu_id']) {
|
|
9145
|
-
cascadingModeParams['sfu_id'] = cascadingModeParams['next_sfu_id'];
|
|
9146
|
-
}
|
|
9147
|
-
return httpClient.doAxiosRequest('post', `/call/${type}/${id}/join`, request, {
|
|
9148
|
-
params: {
|
|
9149
|
-
...cascadingModeParams,
|
|
9150
|
-
},
|
|
9151
|
-
});
|
|
9152
|
-
}
|
|
9153
9140
|
return httpClient.post(`/call/${type}/${id}/join`, request);
|
|
9154
9141
|
};
|
|
9155
9142
|
const toRtcConfiguration = (config) => {
|
|
@@ -9164,20 +9151,6 @@ const toRtcConfiguration = (config) => {
|
|
|
9164
9151
|
};
|
|
9165
9152
|
return rtcConfig;
|
|
9166
9153
|
};
|
|
9167
|
-
const getCascadingModeParams = () => {
|
|
9168
|
-
if (typeof window === 'undefined')
|
|
9169
|
-
return null;
|
|
9170
|
-
const params = new URLSearchParams(window.location?.search);
|
|
9171
|
-
const cascadingEnabled = params.get('cascading') !== null;
|
|
9172
|
-
if (cascadingEnabled) {
|
|
9173
|
-
const rawParams = {};
|
|
9174
|
-
params.forEach((value, key) => {
|
|
9175
|
-
rawParams[key] = value;
|
|
9176
|
-
});
|
|
9177
|
-
return rawParams;
|
|
9178
|
-
}
|
|
9179
|
-
return null;
|
|
9180
|
-
};
|
|
9181
9154
|
/**
|
|
9182
9155
|
* Reconciles the local state of the source participant into the target participant.
|
|
9183
9156
|
*
|
|
@@ -9788,6 +9761,14 @@ class DynascaleManager {
|
|
|
9788
9761
|
audioElement.play().catch((e) => {
|
|
9789
9762
|
this.logger('warn', `Failed to play stream`, e);
|
|
9790
9763
|
});
|
|
9764
|
+
// audio output device shall be set after the audio element is played
|
|
9765
|
+
// otherwise, the browser will not pick it up, and will always
|
|
9766
|
+
// play audio through the system's default device
|
|
9767
|
+
const { selectedDevice } = this.call.speaker.state;
|
|
9768
|
+
if (selectedDevice && 'setSinkId' in audioElement) {
|
|
9769
|
+
// @ts-expect-error setSinkId is not yet in the lib
|
|
9770
|
+
audioElement.setSinkId(selectedDevice);
|
|
9771
|
+
}
|
|
9791
9772
|
}
|
|
9792
9773
|
});
|
|
9793
9774
|
});
|
|
@@ -10602,8 +10583,9 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
10602
10583
|
};
|
|
10603
10584
|
}
|
|
10604
10585
|
/**
|
|
10605
|
-
* Select the camera
|
|
10606
|
-
*
|
|
10586
|
+
* Select the camera direction.
|
|
10587
|
+
*
|
|
10588
|
+
* @param direction the direction of the camera to select.
|
|
10607
10589
|
*/
|
|
10608
10590
|
async selectDirection(direction) {
|
|
10609
10591
|
this.state.setDirection(direction);
|
|
@@ -10633,6 +10615,7 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
10633
10615
|
}
|
|
10634
10616
|
catch (error) {
|
|
10635
10617
|
// couldn't enable device, target resolution will be applied the next time user attempts to start the device
|
|
10618
|
+
this.logger('warn', 'could not apply target resolution', error);
|
|
10636
10619
|
}
|
|
10637
10620
|
}
|
|
10638
10621
|
if (this.state.status === 'enabled') {
|
|
@@ -10640,11 +10623,21 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
10640
10623
|
.mediaStream.getVideoTracks()[0]
|
|
10641
10624
|
?.getSettings();
|
|
10642
10625
|
if (width !== this.targetResolution.width ||
|
|
10643
|
-
height !== this.targetResolution.height)
|
|
10626
|
+
height !== this.targetResolution.height) {
|
|
10644
10627
|
await this.applySettingsToStream();
|
|
10645
|
-
|
|
10628
|
+
this.logger('debug', `${width}x${height} target resolution applied to media stream`);
|
|
10629
|
+
}
|
|
10646
10630
|
}
|
|
10647
10631
|
}
|
|
10632
|
+
/**
|
|
10633
|
+
* Sets the preferred codec for encoding the video.
|
|
10634
|
+
*
|
|
10635
|
+
* @internal internal use only, not part of the public API.
|
|
10636
|
+
* @param codec the codec to use for encoding the video.
|
|
10637
|
+
*/
|
|
10638
|
+
setPreferredCodec(codec) {
|
|
10639
|
+
this.preferredCodec = codec;
|
|
10640
|
+
}
|
|
10648
10641
|
getDevices() {
|
|
10649
10642
|
return getVideoDevices();
|
|
10650
10643
|
}
|
|
@@ -10660,7 +10653,9 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
10660
10653
|
return getVideoStream(constraints);
|
|
10661
10654
|
}
|
|
10662
10655
|
publishStream(stream) {
|
|
10663
|
-
return this.call.publishVideoStream(stream
|
|
10656
|
+
return this.call.publishVideoStream(stream, {
|
|
10657
|
+
preferredCodec: this.preferredCodec,
|
|
10658
|
+
});
|
|
10664
10659
|
}
|
|
10665
10660
|
stopPublishStream(stopTracks) {
|
|
10666
10661
|
return this.call.stopPublish(TrackType.VIDEO, stopTracks);
|
|
@@ -11243,13 +11238,6 @@ class Call {
|
|
|
11243
11238
|
this.state.setCallingState(callingState);
|
|
11244
11239
|
throw error;
|
|
11245
11240
|
}
|
|
11246
|
-
// FIXME OL: remove once cascading is implemented
|
|
11247
|
-
if (typeof window !== 'undefined' && window.location?.search) {
|
|
11248
|
-
const params = new URLSearchParams(window.location.search);
|
|
11249
|
-
sfuServer.url = params.get('sfuUrl') || sfuServer.url;
|
|
11250
|
-
sfuServer.ws_endpoint = params.get('sfuWsUrl') || sfuServer.ws_endpoint;
|
|
11251
|
-
sfuServer.edge_name = params.get('sfuUrl') || sfuServer.edge_name;
|
|
11252
|
-
}
|
|
11253
11241
|
const previousSfuClient = this.sfuClient;
|
|
11254
11242
|
const sfuClient = (this.sfuClient = new StreamSfuClient({
|
|
11255
11243
|
dispatcher: this.dispatcher,
|
|
@@ -11316,8 +11304,11 @@ class Call {
|
|
|
11316
11304
|
// restore previous publishing state
|
|
11317
11305
|
if (audioStream)
|
|
11318
11306
|
await this.publishAudioStream(audioStream);
|
|
11319
|
-
if (videoStream)
|
|
11320
|
-
await this.publishVideoStream(videoStream
|
|
11307
|
+
if (videoStream) {
|
|
11308
|
+
await this.publishVideoStream(videoStream, {
|
|
11309
|
+
preferredCodec: this.camera.preferredCodec,
|
|
11310
|
+
});
|
|
11311
|
+
}
|
|
11321
11312
|
if (screenShare)
|
|
11322
11313
|
await this.publishScreenShareStream(screenShare);
|
|
11323
11314
|
}
|
|
@@ -12343,9 +12334,11 @@ class Call {
|
|
|
12343
12334
|
if (this.camera.state.status === 'enabled' &&
|
|
12344
12335
|
this.camera.state.mediaStream &&
|
|
12345
12336
|
!this.publisher?.isPublishing(TrackType.VIDEO)) {
|
|
12346
|
-
await this.publishVideoStream(this.camera.state.mediaStream
|
|
12337
|
+
await this.publishVideoStream(this.camera.state.mediaStream, {
|
|
12338
|
+
preferredCodec: this.camera.preferredCodec,
|
|
12339
|
+
});
|
|
12347
12340
|
}
|
|
12348
|
-
// Start camera if backend config
|
|
12341
|
+
// Start camera if backend config specifies, and there is no local setting
|
|
12349
12342
|
if (this.camera.state.status === undefined &&
|
|
12350
12343
|
this.state.settings?.video.camera_default_on) {
|
|
12351
12344
|
await this.camera.enable();
|
|
@@ -13960,7 +13953,7 @@ class StreamClient {
|
|
|
13960
13953
|
});
|
|
13961
13954
|
};
|
|
13962
13955
|
this.getUserAgent = () => {
|
|
13963
|
-
const version = "0.4.
|
|
13956
|
+
const version = "0.4.5" ;
|
|
13964
13957
|
return (this.userAgent ||
|
|
13965
13958
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
13966
13959
|
};
|