@stream-io/video-client 0.4.4 → 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 +7 -0
- package/dist/index.browser.es.js +29 -44
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +29 -44
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +29 -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/rtc/flows/join.ts +0 -33
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
|
+
### [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
|
+
|
|
5
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)
|
|
6
13
|
|
|
7
14
|
|
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
|
*
|
|
@@ -10610,8 +10583,9 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
10610
10583
|
};
|
|
10611
10584
|
}
|
|
10612
10585
|
/**
|
|
10613
|
-
* Select the camera
|
|
10614
|
-
*
|
|
10586
|
+
* Select the camera direction.
|
|
10587
|
+
*
|
|
10588
|
+
* @param direction the direction of the camera to select.
|
|
10615
10589
|
*/
|
|
10616
10590
|
async selectDirection(direction) {
|
|
10617
10591
|
this.state.setDirection(direction);
|
|
@@ -10641,6 +10615,7 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
10641
10615
|
}
|
|
10642
10616
|
catch (error) {
|
|
10643
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);
|
|
10644
10619
|
}
|
|
10645
10620
|
}
|
|
10646
10621
|
if (this.state.status === 'enabled') {
|
|
@@ -10648,11 +10623,21 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
10648
10623
|
.mediaStream.getVideoTracks()[0]
|
|
10649
10624
|
?.getSettings();
|
|
10650
10625
|
if (width !== this.targetResolution.width ||
|
|
10651
|
-
height !== this.targetResolution.height)
|
|
10626
|
+
height !== this.targetResolution.height) {
|
|
10652
10627
|
await this.applySettingsToStream();
|
|
10653
|
-
|
|
10628
|
+
this.logger('debug', `${width}x${height} target resolution applied to media stream`);
|
|
10629
|
+
}
|
|
10654
10630
|
}
|
|
10655
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
|
+
}
|
|
10656
10641
|
getDevices() {
|
|
10657
10642
|
return getVideoDevices();
|
|
10658
10643
|
}
|
|
@@ -10668,7 +10653,9 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
10668
10653
|
return getVideoStream(constraints);
|
|
10669
10654
|
}
|
|
10670
10655
|
publishStream(stream) {
|
|
10671
|
-
return this.call.publishVideoStream(stream
|
|
10656
|
+
return this.call.publishVideoStream(stream, {
|
|
10657
|
+
preferredCodec: this.preferredCodec,
|
|
10658
|
+
});
|
|
10672
10659
|
}
|
|
10673
10660
|
stopPublishStream(stopTracks) {
|
|
10674
10661
|
return this.call.stopPublish(TrackType.VIDEO, stopTracks);
|
|
@@ -11251,13 +11238,6 @@ class Call {
|
|
|
11251
11238
|
this.state.setCallingState(callingState);
|
|
11252
11239
|
throw error;
|
|
11253
11240
|
}
|
|
11254
|
-
// FIXME OL: remove once cascading is implemented
|
|
11255
|
-
if (typeof window !== 'undefined' && window.location?.search) {
|
|
11256
|
-
const params = new URLSearchParams(window.location.search);
|
|
11257
|
-
sfuServer.url = params.get('sfuUrl') || sfuServer.url;
|
|
11258
|
-
sfuServer.ws_endpoint = params.get('sfuWsUrl') || sfuServer.ws_endpoint;
|
|
11259
|
-
sfuServer.edge_name = params.get('sfuUrl') || sfuServer.edge_name;
|
|
11260
|
-
}
|
|
11261
11241
|
const previousSfuClient = this.sfuClient;
|
|
11262
11242
|
const sfuClient = (this.sfuClient = new StreamSfuClient({
|
|
11263
11243
|
dispatcher: this.dispatcher,
|
|
@@ -11324,8 +11304,11 @@ class Call {
|
|
|
11324
11304
|
// restore previous publishing state
|
|
11325
11305
|
if (audioStream)
|
|
11326
11306
|
await this.publishAudioStream(audioStream);
|
|
11327
|
-
if (videoStream)
|
|
11328
|
-
await this.publishVideoStream(videoStream
|
|
11307
|
+
if (videoStream) {
|
|
11308
|
+
await this.publishVideoStream(videoStream, {
|
|
11309
|
+
preferredCodec: this.camera.preferredCodec,
|
|
11310
|
+
});
|
|
11311
|
+
}
|
|
11329
11312
|
if (screenShare)
|
|
11330
11313
|
await this.publishScreenShareStream(screenShare);
|
|
11331
11314
|
}
|
|
@@ -12351,9 +12334,11 @@ class Call {
|
|
|
12351
12334
|
if (this.camera.state.status === 'enabled' &&
|
|
12352
12335
|
this.camera.state.mediaStream &&
|
|
12353
12336
|
!this.publisher?.isPublishing(TrackType.VIDEO)) {
|
|
12354
|
-
await this.publishVideoStream(this.camera.state.mediaStream
|
|
12337
|
+
await this.publishVideoStream(this.camera.state.mediaStream, {
|
|
12338
|
+
preferredCodec: this.camera.preferredCodec,
|
|
12339
|
+
});
|
|
12355
12340
|
}
|
|
12356
|
-
// Start camera if backend config
|
|
12341
|
+
// Start camera if backend config specifies, and there is no local setting
|
|
12357
12342
|
if (this.camera.state.status === undefined &&
|
|
12358
12343
|
this.state.settings?.video.camera_default_on) {
|
|
12359
12344
|
await this.camera.enable();
|
|
@@ -13968,7 +13953,7 @@ class StreamClient {
|
|
|
13968
13953
|
});
|
|
13969
13954
|
};
|
|
13970
13955
|
this.getUserAgent = () => {
|
|
13971
|
-
const version = "0.4.
|
|
13956
|
+
const version = "0.4.5" ;
|
|
13972
13957
|
return (this.userAgent ||
|
|
13973
13958
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
13974
13959
|
};
|