@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/dist/index.cjs.js CHANGED
@@ -6441,7 +6441,7 @@ const withSimulcastConstraints = (settings, optimalVideoLayers) => {
6441
6441
  rid: ridMapping[index], // reassign rid
6442
6442
  }));
6443
6443
  };
6444
- const findOptimalScreenSharingLayers = (videoTrack, preferences) => {
6444
+ const findOptimalScreenSharingLayers = (videoTrack, preferences, defaultMaxBitrate = 3000000) => {
6445
6445
  const settings = videoTrack.getSettings();
6446
6446
  return [
6447
6447
  {
@@ -6450,7 +6450,7 @@ const findOptimalScreenSharingLayers = (videoTrack, preferences) => {
6450
6450
  width: settings.width || 0,
6451
6451
  height: settings.height || 0,
6452
6452
  scaleResolutionDownBy: 1,
6453
- maxBitrate: preferences?.maxBitrate ?? 3000000,
6453
+ maxBitrate: preferences?.maxBitrate ?? defaultMaxBitrate,
6454
6454
  maxFramerate: preferences?.maxFramerate ?? 30,
6455
6455
  },
6456
6456
  ];
@@ -7958,10 +7958,11 @@ class Publisher {
7958
7958
  if (!transceiver) {
7959
7959
  const { settings } = this.state;
7960
7960
  const targetResolution = settings?.video.target_resolution;
7961
+ const screenShareBitrate = settings?.screensharing.target_resolution?.bitrate;
7961
7962
  const videoEncodings = trackType === TrackType.VIDEO
7962
7963
  ? findOptimalVideoLayers(track, targetResolution)
7963
7964
  : trackType === TrackType.SCREEN_SHARE
7964
- ? findOptimalScreenSharingLayers(track, opts.screenShareSettings)
7965
+ ? findOptimalScreenSharingLayers(track, opts.screenShareSettings, screenShareBitrate)
7965
7966
  : undefined;
7966
7967
  let preferredCodec = opts.preferredCodec;
7967
7968
  if (!preferredCodec && trackType === TrackType.VIDEO) {
@@ -11643,6 +11644,17 @@ class ScreenShareState extends InputMediaDeviceManagerState {
11643
11644
  class ScreenShareManager extends InputMediaDeviceManager {
11644
11645
  constructor(call) {
11645
11646
  super(call, new ScreenShareState(), TrackType.SCREEN_SHARE);
11647
+ this.subscriptions.push(createSubscription(call.state.settings$, (settings) => {
11648
+ const maybeTargetResolution = settings?.screensharing.target_resolution;
11649
+ if (maybeTargetResolution) {
11650
+ this.setDefaultConstraints({
11651
+ video: {
11652
+ width: maybeTargetResolution.width,
11653
+ height: maybeTargetResolution.height,
11654
+ },
11655
+ });
11656
+ }
11657
+ }));
11646
11658
  }
11647
11659
  /**
11648
11660
  * Will enable screen share audio options on supported platforms.
@@ -14901,7 +14913,7 @@ class StreamClient {
14901
14913
  });
14902
14914
  };
14903
14915
  this.getUserAgent = () => {
14904
- const version = "0.7.11" ;
14916
+ const version = "0.7.12" ;
14905
14917
  return (this.userAgent ||
14906
14918
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
14907
14919
  };