@stream-io/video-client 0.7.11 → 0.7.12
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 +16 -4
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +16 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +16 -4
- package/dist/index.es.js.map +1 -1
- package/dist/src/gen/coordinator/index.d.ts +12 -0
- package/dist/src/rtc/videoLayers.d.ts +1 -1
- package/package.json +1 -1
- package/src/devices/ScreenShareManager.ts +16 -0
- package/src/devices/__tests__/ScreenShareManager.test.ts +35 -7
- package/src/devices/__tests__/mocks.ts +4 -0
- package/src/events/__tests__/call.test.ts +4 -0
- package/src/gen/coordinator/index.ts +12 -0
- package/src/rtc/Publisher.ts +8 -1
- package/src/rtc/__tests__/videoLayers.test.ts +11 -0
- package/src/rtc/videoLayers.ts +2 -1
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.7.12](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.7.11...@stream-io/video-client-0.7.12) (2024-05-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* support target_resolution backend setting for screensharing ([#1336](https://github.com/GetStream/stream-video-js/issues/1336)) ([1e9f796](https://github.com/GetStream/stream-video-js/commit/1e9f7963009ac7fc27ee24abc00eb68749cc19d8))
|
|
11
|
+
|
|
5
12
|
### [0.7.11](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.7.10...@stream-io/video-client-0.7.11) (2024-05-03)
|
|
6
13
|
|
|
7
14
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -6420,7 +6420,7 @@ const withSimulcastConstraints = (settings, optimalVideoLayers) => {
|
|
|
6420
6420
|
rid: ridMapping[index], // reassign rid
|
|
6421
6421
|
}));
|
|
6422
6422
|
};
|
|
6423
|
-
const findOptimalScreenSharingLayers = (videoTrack, preferences) => {
|
|
6423
|
+
const findOptimalScreenSharingLayers = (videoTrack, preferences, defaultMaxBitrate = 3000000) => {
|
|
6424
6424
|
const settings = videoTrack.getSettings();
|
|
6425
6425
|
return [
|
|
6426
6426
|
{
|
|
@@ -6429,7 +6429,7 @@ const findOptimalScreenSharingLayers = (videoTrack, preferences) => {
|
|
|
6429
6429
|
width: settings.width || 0,
|
|
6430
6430
|
height: settings.height || 0,
|
|
6431
6431
|
scaleResolutionDownBy: 1,
|
|
6432
|
-
maxBitrate: preferences?.maxBitrate ??
|
|
6432
|
+
maxBitrate: preferences?.maxBitrate ?? defaultMaxBitrate,
|
|
6433
6433
|
maxFramerate: preferences?.maxFramerate ?? 30,
|
|
6434
6434
|
},
|
|
6435
6435
|
];
|
|
@@ -7937,10 +7937,11 @@ class Publisher {
|
|
|
7937
7937
|
if (!transceiver) {
|
|
7938
7938
|
const { settings } = this.state;
|
|
7939
7939
|
const targetResolution = settings?.video.target_resolution;
|
|
7940
|
+
const screenShareBitrate = settings?.screensharing.target_resolution?.bitrate;
|
|
7940
7941
|
const videoEncodings = trackType === TrackType.VIDEO
|
|
7941
7942
|
? findOptimalVideoLayers(track, targetResolution)
|
|
7942
7943
|
: trackType === TrackType.SCREEN_SHARE
|
|
7943
|
-
? findOptimalScreenSharingLayers(track, opts.screenShareSettings)
|
|
7944
|
+
? findOptimalScreenSharingLayers(track, opts.screenShareSettings, screenShareBitrate)
|
|
7944
7945
|
: undefined;
|
|
7945
7946
|
let preferredCodec = opts.preferredCodec;
|
|
7946
7947
|
if (!preferredCodec && trackType === TrackType.VIDEO) {
|
|
@@ -11622,6 +11623,17 @@ class ScreenShareState extends InputMediaDeviceManagerState {
|
|
|
11622
11623
|
class ScreenShareManager extends InputMediaDeviceManager {
|
|
11623
11624
|
constructor(call) {
|
|
11624
11625
|
super(call, new ScreenShareState(), TrackType.SCREEN_SHARE);
|
|
11626
|
+
this.subscriptions.push(createSubscription(call.state.settings$, (settings) => {
|
|
11627
|
+
const maybeTargetResolution = settings?.screensharing.target_resolution;
|
|
11628
|
+
if (maybeTargetResolution) {
|
|
11629
|
+
this.setDefaultConstraints({
|
|
11630
|
+
video: {
|
|
11631
|
+
width: maybeTargetResolution.width,
|
|
11632
|
+
height: maybeTargetResolution.height,
|
|
11633
|
+
},
|
|
11634
|
+
});
|
|
11635
|
+
}
|
|
11636
|
+
}));
|
|
11625
11637
|
}
|
|
11626
11638
|
/**
|
|
11627
11639
|
* Will enable screen share audio options on supported platforms.
|
|
@@ -14882,7 +14894,7 @@ class StreamClient {
|
|
|
14882
14894
|
});
|
|
14883
14895
|
};
|
|
14884
14896
|
this.getUserAgent = () => {
|
|
14885
|
-
const version = "0.7.
|
|
14897
|
+
const version = "0.7.12" ;
|
|
14886
14898
|
return (this.userAgent ||
|
|
14887
14899
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
14888
14900
|
};
|