@whereby.com/media 1.28.0 → 1.29.0

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 CHANGED
@@ -1674,31 +1674,6 @@ class RtcStream {
1674
1674
  }
1675
1675
  }
1676
1676
 
1677
- const lowPixelCount = 320 * 180;
1678
- const lowBitratePerPixel = 150000 / lowPixelCount;
1679
- const highPixelCount = 1280 * 720;
1680
- const highBitratePerPixel = 1000000 / highPixelCount;
1681
- const bitrateChangePerPixel = (highBitratePerPixel - lowBitratePerPixel) / (highPixelCount - lowPixelCount);
1682
- function getOptimalBitrate(width, height, frameRate) {
1683
- let targetPixelCount = width * height;
1684
- if (targetPixelCount < lowPixelCount)
1685
- targetPixelCount = lowPixelCount;
1686
- if (targetPixelCount > highPixelCount)
1687
- targetPixelCount = highPixelCount;
1688
- let targetBitratePerPixel = lowBitratePerPixel;
1689
- if (targetPixelCount > highPixelCount)
1690
- targetBitratePerPixel = highBitratePerPixel;
1691
- else if (targetPixelCount > lowPixelCount) {
1692
- targetBitratePerPixel += (targetPixelCount - lowPixelCount) * bitrateChangePerPixel;
1693
- }
1694
- let targetBitrate = width * height * targetBitratePerPixel;
1695
- if (frameRate <= 15)
1696
- targetBitrate = targetBitrate * 0.7;
1697
- else if (frameRate <= 24)
1698
- targetBitrate = targetBitrate * 0.9;
1699
- return targetBitrate;
1700
- }
1701
-
1702
1677
  const word = "[a-fA-F\\d:]";
1703
1678
  const boundry = (options) => options && options.includeBoundaries ? `(?:(?<=\\s|^)(?=${word})|(?<=${word})(?=\\s|$))` : "";
1704
1679
  const v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
@@ -2576,14 +2551,6 @@ const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY = {
2576
2551
  const SCREEN_SHARE_SETTINGS = {
2577
2552
  encodings: [{}],
2578
2553
  };
2579
- const SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH = {
2580
- encodings: [
2581
- {
2582
- maxBitrate: 600000,
2583
- maxFramerate: 2,
2584
- },
2585
- ],
2586
- };
2587
2554
  const SCREEN_SHARE_SIMULCAST_SETTINGS = {
2588
2555
  encodings: [
2589
2556
  { scaleResolutionDownBy: 2, dtx: true, maxBitrate: 500000 },
@@ -2604,7 +2571,7 @@ const SCREEN_SHARE_SETTINGS_VP9 = {
2604
2571
  encodings: [{ dtx: true }],
2605
2572
  };
2606
2573
  const getMediaSettings = (kind, isScreenShare, features, isSomeoneAlreadyPresenting = false) => {
2607
- const { lowDataModeEnabled, simulcastScreenshareOn, lowBandwidth, vp9On, svcKeyScalabilityModeOn } = features;
2574
+ const { lowDataModeEnabled, simulcastScreenshareOn, vp9On, svcKeyScalabilityModeOn } = features;
2608
2575
  if (kind === "audio") {
2609
2576
  return AUDIO_SETTINGS;
2610
2577
  }
@@ -2612,7 +2579,6 @@ const getMediaSettings = (kind, isScreenShare, features, isSomeoneAlreadyPresent
2612
2579
  const isVp9Available = isChrome && vp9On;
2613
2580
  if (isScreenShare) {
2614
2581
  return getScreenShareMediaSettings({
2615
- lowBandwidth: lowBandwidth,
2616
2582
  isVp9Available,
2617
2583
  isSomeoneAlreadyPresenting,
2618
2584
  simulcastScreenshareOn,
@@ -2620,7 +2586,7 @@ const getMediaSettings = (kind, isScreenShare, features, isSomeoneAlreadyPresent
2620
2586
  }
2621
2587
  else {
2622
2588
  return getCameraMediaSettings({
2623
- lowBandwidth: lowBandwidth || lowDataModeEnabled,
2589
+ lowBandwidth: lowDataModeEnabled,
2624
2590
  isVp9Available,
2625
2591
  svcKeyScalabilityModeOn,
2626
2592
  });
@@ -2642,14 +2608,12 @@ const getCameraMediaSettings = ({ lowBandwidth, isVp9Available, svcKeyScalabilit
2642
2608
  }
2643
2609
  return VIDEO_SETTINGS_HD;
2644
2610
  };
2645
- const getScreenShareMediaSettings = ({ lowBandwidth, isVp9Available, isSomeoneAlreadyPresenting, simulcastScreenshareOn, }) => {
2611
+ const getScreenShareMediaSettings = ({ isVp9Available, isSomeoneAlreadyPresenting, simulcastScreenshareOn, }) => {
2646
2612
  if (isSomeoneAlreadyPresenting) {
2647
2613
  if (isVp9Available)
2648
2614
  return ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9;
2649
2615
  return ADDITIONAL_SCREEN_SHARE_SETTINGS;
2650
2616
  }
2651
- if (lowBandwidth && !isVp9Available)
2652
- return SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH;
2653
2617
  if (isVp9Available)
2654
2618
  return SCREEN_SHARE_SETTINGS_VP9;
2655
2619
  if (simulcastScreenshareOn)
@@ -4009,12 +3973,12 @@ class P2pRtcManager {
4009
3973
  if (numPeers > 7) {
4010
3974
  numPeers = 7;
4011
3975
  }
4012
- let bandwidth = this._features.bandwidth
3976
+ const bandwidth = this._features.bandwidth
4013
3977
  ? parseInt(this._features.bandwidth, 10)
4014
3978
  : {
4015
- 1: this._features.lowBandwidth ? 768 : 0,
4016
- 2: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 768 : 384,
4017
- 3: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 512 : 256,
3979
+ 1: 0,
3980
+ 2: 384,
3981
+ 3: 256,
4018
3982
  4: 192,
4019
3983
  5: 128,
4020
3984
  6: 128,
@@ -4023,22 +3987,6 @@ class P2pRtcManager {
4023
3987
  if (bandwidth === undefined) {
4024
3988
  return 0;
4025
3989
  }
4026
- if (this._features.adjustBitratesFromResolution) {
4027
- const cameraStream = this._getLocalCameraStream();
4028
- if (cameraStream) {
4029
- const cameraTrack = cameraStream && cameraStream.getVideoTracks()[0];
4030
- if (cameraTrack) {
4031
- const { width, height, frameRate } = cameraTrack.getSettings();
4032
- if (width && height && frameRate) {
4033
- const optimalBandwidth = Math.round(getOptimalBitrate(width, height, frameRate) / 1000);
4034
- bandwidth = Math.min(optimalBandwidth, bandwidth || optimalBandwidth);
4035
- }
4036
- }
4037
- }
4038
- }
4039
- if (this._features.higherP2PBitrates && !this._features.lowBandwidth) {
4040
- bandwidth = bandwidth * 1.5;
4041
- }
4042
3990
  this._forEachPeerConnection((session) => {
4043
3991
  session.changeBandwidth(bandwidth);
4044
3992
  });
@@ -5657,7 +5605,7 @@ class VegaRtcManager {
5657
5605
  return;
5658
5606
  }
5659
5607
  this._webcamProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
5660
- var _b, _c;
5608
+ var _b;
5661
5609
  try {
5662
5610
  const currentPaused = this._webcamPaused;
5663
5611
  const producer = yield this._sendTransport.produce(Object.assign(Object.assign({ track: this._webcamTrack, disableTrackOnPause: false, stopTracks: false }, getMediaSettings("video", false, Object.assign(Object.assign({}, this._features), { vp9On: this._features.sfuVp9On }))), { appData: {
@@ -5695,9 +5643,6 @@ class VegaRtcManager {
5695
5643
  this._stopProducer(this._webcamProducer);
5696
5644
  this._webcamProducer = null;
5697
5645
  }
5698
- if (this._features.lowBandwidth && this._screenVideoTrack) {
5699
- (_c = this._webcamProducer) === null || _c === void 0 ? void 0 : _c.setMaxSpatialLayer(0);
5700
- }
5701
5646
  }
5702
5647
  }))();
5703
5648
  });
@@ -5756,7 +5701,6 @@ class VegaRtcManager {
5756
5701
  return __awaiter(this, void 0, void 0, function* () {
5757
5702
  logger$3.info("_internalSendScreenVideo()");
5758
5703
  this._screenVideoProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
5759
- var _a, _b;
5760
5704
  try {
5761
5705
  if (!this._screenVideoTrack || !this._sendTransport || this._screenVideoProducer) {
5762
5706
  this._screenVideoProducerPromise = null;
@@ -5782,9 +5726,6 @@ class VegaRtcManager {
5782
5726
  });
5783
5727
  if (this._screenVideoTrack !== this._screenVideoProducer.track)
5784
5728
  yield this._replaceScreenVideoTrack();
5785
- if (this._features.lowBandwidth) {
5786
- (_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(0);
5787
- }
5788
5729
  }
5789
5730
  catch (error) {
5790
5731
  logger$3.error("screenVideoProducer failed:%o", error);
@@ -5794,9 +5735,6 @@ class VegaRtcManager {
5794
5735
  if (!this._screenVideoTrack) {
5795
5736
  yield this._stopProducer(this._screenVideoProducer);
5796
5737
  this._screenVideoProducer = null;
5797
- if (this._features.lowBandwidth) {
5798
- (_b = this._webcamProducer) === null || _b === void 0 ? void 0 : _b.setMaxSpatialLayer(Number.MAX_VALUE);
5799
- }
5800
5738
  }
5801
5739
  }
5802
5740
  }))();
@@ -5962,7 +5900,6 @@ class VegaRtcManager {
5962
5900
  }
5963
5901
  }
5964
5902
  removeStream(streamId, _stream, requestedByClientId) {
5965
- var _a;
5966
5903
  logger$3.info("removeStream() [streamId:%s, requestedByClientId:%s]", streamId, requestedByClientId);
5967
5904
  this._emitToSignal(PROTOCOL_REQUESTS.STOP_SCREENSHARE, {
5968
5905
  streamId: OUTBOUND_SCREEN_OUTBOUND_STREAM_ID,
@@ -5974,9 +5911,6 @@ class VegaRtcManager {
5974
5911
  this._stopProducer(this._screenAudioProducer);
5975
5912
  this._screenAudioProducer = null;
5976
5913
  this._screenAudioTrack = null;
5977
- if (this._features.lowBandwidth) {
5978
- (_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(Number.MAX_VALUE);
5979
- }
5980
5914
  }
5981
5915
  _onMicAnalyserScoreUpdated(data) {
5982
5916
  var _a, _b;
@@ -8101,7 +8035,6 @@ exports.ReconnectManager = ReconnectManager;
8101
8035
  exports.RtcManagerDispatcher = RtcManagerDispatcher;
8102
8036
  exports.RtcStream = RtcStream;
8103
8037
  exports.SCREEN_SHARE_SETTINGS = SCREEN_SHARE_SETTINGS;
8104
- exports.SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH = SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH;
8105
8038
  exports.SCREEN_SHARE_SETTINGS_VP9 = SCREEN_SHARE_SETTINGS_VP9;
8106
8039
  exports.SCREEN_SHARE_SIMULCAST_SETTINGS = SCREEN_SHARE_SIMULCAST_SETTINGS;
8107
8040
  exports.STREAM_TYPES = STREAM_TYPES;
@@ -8153,7 +8086,6 @@ exports.getMediasoupDevice = getMediasoupDevice;
8153
8086
  exports.getNumFailedStatsReports = getNumFailedStatsReports;
8154
8087
  exports.getNumFailedTrackSsrcLookups = getNumFailedTrackSsrcLookups;
8155
8088
  exports.getNumMissingTrackSsrcLookups = getNumMissingTrackSsrcLookups;
8156
- exports.getOptimalBitrate = getOptimalBitrate;
8157
8089
  exports.getPeerConnectionIndex = getPeerConnectionIndex;
8158
8090
  exports.getStats = getStats;
8159
8091
  exports.getStream = getStream;
package/dist/index.d.cts CHANGED
@@ -663,12 +663,6 @@ declare const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY: {
663
663
  declare const SCREEN_SHARE_SETTINGS: {
664
664
  encodings: {}[];
665
665
  };
666
- declare const SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH: {
667
- encodings: {
668
- maxBitrate: number;
669
- maxFramerate: number;
670
- }[];
671
- };
672
666
  declare const SCREEN_SHARE_SIMULCAST_SETTINGS: {
673
667
  encodings: {
674
668
  scaleResolutionDownBy: number;
@@ -698,7 +692,6 @@ declare const SCREEN_SHARE_SETTINGS_VP9: {
698
692
  declare const getMediaSettings: (kind: string, isScreenShare: boolean, features: {
699
693
  lowDataModeEnabled?: boolean;
700
694
  simulcastScreenshareOn?: boolean;
701
- lowBandwidth?: boolean;
702
695
  vp9On?: boolean;
703
696
  svcKeyScalabilityModeOn?: boolean;
704
697
  }, isSomeoneAlreadyPresenting?: boolean) => {
@@ -719,8 +712,6 @@ declare function sortCodecs(codecs: Codec[], features: {
719
712
  preferHardwareDecodingOn?: boolean;
720
713
  }): Promise<Codec[]>;
721
714
 
722
- declare function getOptimalBitrate(width: number, height: number, frameRate: number): number;
723
-
724
715
  declare class ReconnectManager extends EventEmitter {
725
716
  _socket: any;
726
717
  _clients: any;
@@ -1817,4 +1808,4 @@ declare class RtcStream {
1817
1808
  static getTypeFromId(id: string): string;
1818
1809
  }
1819
1810
 
1820
- export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type BreakoutConfig, type BreakoutGroupJoinedEvent, type BreakoutSessionUpdatedEvent, type CannotJoinUnclaimedRoomError, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Codec, type Credentials, type CustomMediaStreamTrack, EVENTS, type ForbiddenError, type ForbiddenErrorNames, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type HostPresenceControlsError, type IdentifyDeviceRequest, type InternalServerError, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type MaxViewerLimitReachedError, type NewClientEvent, NoDevicesError, type OrganizationPlanExhaustedError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomConcurrencyControlsError, type RoomFullError, type RoomJoinedErrors, type RoomJoinedEvent, type RoomJoinedSuccess, type RoomKnockedEvent, type RoomLockedError, type RoomLockedEvent, type RoomMeetingTimeExhaustedError, type RoomMode, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH, SCREEN_SHARE_SETTINGS_VP9, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, type StatsSubscription, TYPES, type TrackStats, type TurnTransportProtocol, type UpdatedDeviceInfo, type UpdatedDevicesInfo, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_KEY, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, type ViewStats, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, type ssrcStats, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
1811
+ export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type BreakoutConfig, type BreakoutGroupJoinedEvent, type BreakoutSessionUpdatedEvent, type CannotJoinUnclaimedRoomError, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Codec, type Credentials, type CustomMediaStreamTrack, EVENTS, type ForbiddenError, type ForbiddenErrorNames, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type HostPresenceControlsError, type IdentifyDeviceRequest, type InternalServerError, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type MaxViewerLimitReachedError, type NewClientEvent, NoDevicesError, type OrganizationPlanExhaustedError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomConcurrencyControlsError, type RoomFullError, type RoomJoinedErrors, type RoomJoinedEvent, type RoomJoinedSuccess, type RoomKnockedEvent, type RoomLockedError, type RoomLockedEvent, type RoomMeetingTimeExhaustedError, type RoomMode, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_VP9, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, type StatsSubscription, TYPES, type TrackStats, type TurnTransportProtocol, type UpdatedDeviceInfo, type UpdatedDevicesInfo, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_KEY, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, type ViewStats, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, type ssrcStats, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
package/dist/index.d.mts CHANGED
@@ -663,12 +663,6 @@ declare const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY: {
663
663
  declare const SCREEN_SHARE_SETTINGS: {
664
664
  encodings: {}[];
665
665
  };
666
- declare const SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH: {
667
- encodings: {
668
- maxBitrate: number;
669
- maxFramerate: number;
670
- }[];
671
- };
672
666
  declare const SCREEN_SHARE_SIMULCAST_SETTINGS: {
673
667
  encodings: {
674
668
  scaleResolutionDownBy: number;
@@ -698,7 +692,6 @@ declare const SCREEN_SHARE_SETTINGS_VP9: {
698
692
  declare const getMediaSettings: (kind: string, isScreenShare: boolean, features: {
699
693
  lowDataModeEnabled?: boolean;
700
694
  simulcastScreenshareOn?: boolean;
701
- lowBandwidth?: boolean;
702
695
  vp9On?: boolean;
703
696
  svcKeyScalabilityModeOn?: boolean;
704
697
  }, isSomeoneAlreadyPresenting?: boolean) => {
@@ -719,8 +712,6 @@ declare function sortCodecs(codecs: Codec[], features: {
719
712
  preferHardwareDecodingOn?: boolean;
720
713
  }): Promise<Codec[]>;
721
714
 
722
- declare function getOptimalBitrate(width: number, height: number, frameRate: number): number;
723
-
724
715
  declare class ReconnectManager extends EventEmitter {
725
716
  _socket: any;
726
717
  _clients: any;
@@ -1817,4 +1808,4 @@ declare class RtcStream {
1817
1808
  static getTypeFromId(id: string): string;
1818
1809
  }
1819
1810
 
1820
- export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type BreakoutConfig, type BreakoutGroupJoinedEvent, type BreakoutSessionUpdatedEvent, type CannotJoinUnclaimedRoomError, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Codec, type Credentials, type CustomMediaStreamTrack, EVENTS, type ForbiddenError, type ForbiddenErrorNames, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type HostPresenceControlsError, type IdentifyDeviceRequest, type InternalServerError, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type MaxViewerLimitReachedError, type NewClientEvent, NoDevicesError, type OrganizationPlanExhaustedError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomConcurrencyControlsError, type RoomFullError, type RoomJoinedErrors, type RoomJoinedEvent, type RoomJoinedSuccess, type RoomKnockedEvent, type RoomLockedError, type RoomLockedEvent, type RoomMeetingTimeExhaustedError, type RoomMode, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH, SCREEN_SHARE_SETTINGS_VP9, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, type StatsSubscription, TYPES, type TrackStats, type TurnTransportProtocol, type UpdatedDeviceInfo, type UpdatedDevicesInfo, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_KEY, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, type ViewStats, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, type ssrcStats, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
1811
+ export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type BreakoutConfig, type BreakoutGroupJoinedEvent, type BreakoutSessionUpdatedEvent, type CannotJoinUnclaimedRoomError, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Codec, type Credentials, type CustomMediaStreamTrack, EVENTS, type ForbiddenError, type ForbiddenErrorNames, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type HostPresenceControlsError, type IdentifyDeviceRequest, type InternalServerError, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type MaxViewerLimitReachedError, type NewClientEvent, NoDevicesError, type OrganizationPlanExhaustedError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomConcurrencyControlsError, type RoomFullError, type RoomJoinedErrors, type RoomJoinedEvent, type RoomJoinedSuccess, type RoomKnockedEvent, type RoomLockedError, type RoomLockedEvent, type RoomMeetingTimeExhaustedError, type RoomMode, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_VP9, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, type StatsSubscription, TYPES, type TrackStats, type TurnTransportProtocol, type UpdatedDeviceInfo, type UpdatedDevicesInfo, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_KEY, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, type ViewStats, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, type ssrcStats, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
package/dist/index.d.ts CHANGED
@@ -663,12 +663,6 @@ declare const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY: {
663
663
  declare const SCREEN_SHARE_SETTINGS: {
664
664
  encodings: {}[];
665
665
  };
666
- declare const SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH: {
667
- encodings: {
668
- maxBitrate: number;
669
- maxFramerate: number;
670
- }[];
671
- };
672
666
  declare const SCREEN_SHARE_SIMULCAST_SETTINGS: {
673
667
  encodings: {
674
668
  scaleResolutionDownBy: number;
@@ -698,7 +692,6 @@ declare const SCREEN_SHARE_SETTINGS_VP9: {
698
692
  declare const getMediaSettings: (kind: string, isScreenShare: boolean, features: {
699
693
  lowDataModeEnabled?: boolean;
700
694
  simulcastScreenshareOn?: boolean;
701
- lowBandwidth?: boolean;
702
695
  vp9On?: boolean;
703
696
  svcKeyScalabilityModeOn?: boolean;
704
697
  }, isSomeoneAlreadyPresenting?: boolean) => {
@@ -719,8 +712,6 @@ declare function sortCodecs(codecs: Codec[], features: {
719
712
  preferHardwareDecodingOn?: boolean;
720
713
  }): Promise<Codec[]>;
721
714
 
722
- declare function getOptimalBitrate(width: number, height: number, frameRate: number): number;
723
-
724
715
  declare class ReconnectManager extends EventEmitter {
725
716
  _socket: any;
726
717
  _clients: any;
@@ -1817,4 +1808,4 @@ declare class RtcStream {
1817
1808
  static getTypeFromId(id: string): string;
1818
1809
  }
1819
1810
 
1820
- export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type BreakoutConfig, type BreakoutGroupJoinedEvent, type BreakoutSessionUpdatedEvent, type CannotJoinUnclaimedRoomError, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Codec, type Credentials, type CustomMediaStreamTrack, EVENTS, type ForbiddenError, type ForbiddenErrorNames, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type HostPresenceControlsError, type IdentifyDeviceRequest, type InternalServerError, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type MaxViewerLimitReachedError, type NewClientEvent, NoDevicesError, type OrganizationPlanExhaustedError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomConcurrencyControlsError, type RoomFullError, type RoomJoinedErrors, type RoomJoinedEvent, type RoomJoinedSuccess, type RoomKnockedEvent, type RoomLockedError, type RoomLockedEvent, type RoomMeetingTimeExhaustedError, type RoomMode, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH, SCREEN_SHARE_SETTINGS_VP9, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, type StatsSubscription, TYPES, type TrackStats, type TurnTransportProtocol, type UpdatedDeviceInfo, type UpdatedDevicesInfo, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_KEY, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, type ViewStats, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, type ssrcStats, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
1811
+ export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, type AddSpotlightRequest, type AudioEnableRequest, type AudioEnableRequestedEvent, type AudioEnabledEvent, BandwidthTester, type BreakoutConfig, type BreakoutGroupJoinedEvent, type BreakoutSessionUpdatedEvent, type CannotJoinUnclaimedRoomError, type ChatMessage, type ClientKickedEvent, type ClientLeftEvent, type ClientMetadataPayload, type ClientMetadataReceivedEvent, type ClientRole, type ClientUnableToJoinEvent, type CloudRecordingStartedEvent, type Codec, type Credentials, type CustomMediaStreamTrack, EVENTS, type ForbiddenError, type ForbiddenErrorNames, type GetConstraintsOptions, type GetDeviceDataResult, type GetMediaConstraintsOptions, type GetStreamOptions, type GetStreamResult, type GetUpdatedDevicesResult, type HostPresenceControlsError, type IdentifyDeviceRequest, type InternalServerError, type IssuesAndMetricsByView, type JoinRoomRequest, KNOCK_MESSAGES, KalmanFilter, type KnockAcceptedEvent, type KnockRejectedEvent, type KnockRoomRequest, type KnockerLeftEvent, type LiveTranscriptionStartedEvent, type LiveTranscriptionStoppedEvent, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, type MaxViewerLimitReachedError, type NewClientEvent, NoDevicesError, type OrganizationPlanExhaustedError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, type RemoveSpotlightRequest, type RoleName, type RoomConcurrencyControlsError, type RoomFullError, type RoomJoinedErrors, type RoomJoinedEvent, type RoomJoinedSuccess, type RoomKnockedEvent, type RoomLockedError, type RoomLockedEvent, type RoomMeetingTimeExhaustedError, type RoomMode, type RoomSessionEndedEvent, type RtcClientConnectionStatusChangedPayload, RtcEventNames, type RtcEvents, type RtcLocalStreamTrackAddedPayload, type RtcLocalStreamTrackRemovedPayload, type RtcManager, type RtcManagerCreatedPayload, RtcManagerDispatcher, RtcStream, type RtcStreamAddedPayload, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_VP9, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, type ScreenshareStartedEvent, type ScreenshareStoppedEvent, type SendClientMetadataRequest, ServerSocket, Session, SfuV2Parser, type SignalClient, type SignalEvents, type SignalKnocker, type SignalRequests, type SocketConf, type SocketManager, type Spotlight, type SpotlightAddedEvent, type SpotlightRemovedEvent, type StatsMonitorOptions, type StatsMonitorState, type StatsSubscription, TYPES, type TrackStats, type TurnTransportProtocol, type UpdatedDeviceInfo, type UpdatedDevicesInfo, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_KEY, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, type VideoEnableRequest, type VideoEnableRequestedEvent, type VideoEnabledEvent, type ViewStats, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, type ssrcStats, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
package/dist/index.mjs CHANGED
@@ -1649,31 +1649,6 @@ class RtcStream {
1649
1649
  }
1650
1650
  }
1651
1651
 
1652
- const lowPixelCount = 320 * 180;
1653
- const lowBitratePerPixel = 150000 / lowPixelCount;
1654
- const highPixelCount = 1280 * 720;
1655
- const highBitratePerPixel = 1000000 / highPixelCount;
1656
- const bitrateChangePerPixel = (highBitratePerPixel - lowBitratePerPixel) / (highPixelCount - lowPixelCount);
1657
- function getOptimalBitrate(width, height, frameRate) {
1658
- let targetPixelCount = width * height;
1659
- if (targetPixelCount < lowPixelCount)
1660
- targetPixelCount = lowPixelCount;
1661
- if (targetPixelCount > highPixelCount)
1662
- targetPixelCount = highPixelCount;
1663
- let targetBitratePerPixel = lowBitratePerPixel;
1664
- if (targetPixelCount > highPixelCount)
1665
- targetBitratePerPixel = highBitratePerPixel;
1666
- else if (targetPixelCount > lowPixelCount) {
1667
- targetBitratePerPixel += (targetPixelCount - lowPixelCount) * bitrateChangePerPixel;
1668
- }
1669
- let targetBitrate = width * height * targetBitratePerPixel;
1670
- if (frameRate <= 15)
1671
- targetBitrate = targetBitrate * 0.7;
1672
- else if (frameRate <= 24)
1673
- targetBitrate = targetBitrate * 0.9;
1674
- return targetBitrate;
1675
- }
1676
-
1677
1652
  const word = "[a-fA-F\\d:]";
1678
1653
  const boundry = (options) => options && options.includeBoundaries ? `(?:(?<=\\s|^)(?=${word})|(?<=${word})(?=\\s|$))` : "";
1679
1654
  const v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
@@ -2551,14 +2526,6 @@ const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY = {
2551
2526
  const SCREEN_SHARE_SETTINGS = {
2552
2527
  encodings: [{}],
2553
2528
  };
2554
- const SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH = {
2555
- encodings: [
2556
- {
2557
- maxBitrate: 600000,
2558
- maxFramerate: 2,
2559
- },
2560
- ],
2561
- };
2562
2529
  const SCREEN_SHARE_SIMULCAST_SETTINGS = {
2563
2530
  encodings: [
2564
2531
  { scaleResolutionDownBy: 2, dtx: true, maxBitrate: 500000 },
@@ -2579,7 +2546,7 @@ const SCREEN_SHARE_SETTINGS_VP9 = {
2579
2546
  encodings: [{ dtx: true }],
2580
2547
  };
2581
2548
  const getMediaSettings = (kind, isScreenShare, features, isSomeoneAlreadyPresenting = false) => {
2582
- const { lowDataModeEnabled, simulcastScreenshareOn, lowBandwidth, vp9On, svcKeyScalabilityModeOn } = features;
2549
+ const { lowDataModeEnabled, simulcastScreenshareOn, vp9On, svcKeyScalabilityModeOn } = features;
2583
2550
  if (kind === "audio") {
2584
2551
  return AUDIO_SETTINGS;
2585
2552
  }
@@ -2587,7 +2554,6 @@ const getMediaSettings = (kind, isScreenShare, features, isSomeoneAlreadyPresent
2587
2554
  const isVp9Available = isChrome && vp9On;
2588
2555
  if (isScreenShare) {
2589
2556
  return getScreenShareMediaSettings({
2590
- lowBandwidth: lowBandwidth,
2591
2557
  isVp9Available,
2592
2558
  isSomeoneAlreadyPresenting,
2593
2559
  simulcastScreenshareOn,
@@ -2595,7 +2561,7 @@ const getMediaSettings = (kind, isScreenShare, features, isSomeoneAlreadyPresent
2595
2561
  }
2596
2562
  else {
2597
2563
  return getCameraMediaSettings({
2598
- lowBandwidth: lowBandwidth || lowDataModeEnabled,
2564
+ lowBandwidth: lowDataModeEnabled,
2599
2565
  isVp9Available,
2600
2566
  svcKeyScalabilityModeOn,
2601
2567
  });
@@ -2617,14 +2583,12 @@ const getCameraMediaSettings = ({ lowBandwidth, isVp9Available, svcKeyScalabilit
2617
2583
  }
2618
2584
  return VIDEO_SETTINGS_HD;
2619
2585
  };
2620
- const getScreenShareMediaSettings = ({ lowBandwidth, isVp9Available, isSomeoneAlreadyPresenting, simulcastScreenshareOn, }) => {
2586
+ const getScreenShareMediaSettings = ({ isVp9Available, isSomeoneAlreadyPresenting, simulcastScreenshareOn, }) => {
2621
2587
  if (isSomeoneAlreadyPresenting) {
2622
2588
  if (isVp9Available)
2623
2589
  return ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9;
2624
2590
  return ADDITIONAL_SCREEN_SHARE_SETTINGS;
2625
2591
  }
2626
- if (lowBandwidth && !isVp9Available)
2627
- return SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH;
2628
2592
  if (isVp9Available)
2629
2593
  return SCREEN_SHARE_SETTINGS_VP9;
2630
2594
  if (simulcastScreenshareOn)
@@ -3984,12 +3948,12 @@ class P2pRtcManager {
3984
3948
  if (numPeers > 7) {
3985
3949
  numPeers = 7;
3986
3950
  }
3987
- let bandwidth = this._features.bandwidth
3951
+ const bandwidth = this._features.bandwidth
3988
3952
  ? parseInt(this._features.bandwidth, 10)
3989
3953
  : {
3990
- 1: this._features.lowBandwidth ? 768 : 0,
3991
- 2: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 768 : 384,
3992
- 3: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 512 : 256,
3954
+ 1: 0,
3955
+ 2: 384,
3956
+ 3: 256,
3993
3957
  4: 192,
3994
3958
  5: 128,
3995
3959
  6: 128,
@@ -3998,22 +3962,6 @@ class P2pRtcManager {
3998
3962
  if (bandwidth === undefined) {
3999
3963
  return 0;
4000
3964
  }
4001
- if (this._features.adjustBitratesFromResolution) {
4002
- const cameraStream = this._getLocalCameraStream();
4003
- if (cameraStream) {
4004
- const cameraTrack = cameraStream && cameraStream.getVideoTracks()[0];
4005
- if (cameraTrack) {
4006
- const { width, height, frameRate } = cameraTrack.getSettings();
4007
- if (width && height && frameRate) {
4008
- const optimalBandwidth = Math.round(getOptimalBitrate(width, height, frameRate) / 1000);
4009
- bandwidth = Math.min(optimalBandwidth, bandwidth || optimalBandwidth);
4010
- }
4011
- }
4012
- }
4013
- }
4014
- if (this._features.higherP2PBitrates && !this._features.lowBandwidth) {
4015
- bandwidth = bandwidth * 1.5;
4016
- }
4017
3965
  this._forEachPeerConnection((session) => {
4018
3966
  session.changeBandwidth(bandwidth);
4019
3967
  });
@@ -5632,7 +5580,7 @@ class VegaRtcManager {
5632
5580
  return;
5633
5581
  }
5634
5582
  this._webcamProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
5635
- var _b, _c;
5583
+ var _b;
5636
5584
  try {
5637
5585
  const currentPaused = this._webcamPaused;
5638
5586
  const producer = yield this._sendTransport.produce(Object.assign(Object.assign({ track: this._webcamTrack, disableTrackOnPause: false, stopTracks: false }, getMediaSettings("video", false, Object.assign(Object.assign({}, this._features), { vp9On: this._features.sfuVp9On }))), { appData: {
@@ -5670,9 +5618,6 @@ class VegaRtcManager {
5670
5618
  this._stopProducer(this._webcamProducer);
5671
5619
  this._webcamProducer = null;
5672
5620
  }
5673
- if (this._features.lowBandwidth && this._screenVideoTrack) {
5674
- (_c = this._webcamProducer) === null || _c === void 0 ? void 0 : _c.setMaxSpatialLayer(0);
5675
- }
5676
5621
  }
5677
5622
  }))();
5678
5623
  });
@@ -5731,7 +5676,6 @@ class VegaRtcManager {
5731
5676
  return __awaiter(this, void 0, void 0, function* () {
5732
5677
  logger$3.info("_internalSendScreenVideo()");
5733
5678
  this._screenVideoProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
5734
- var _a, _b;
5735
5679
  try {
5736
5680
  if (!this._screenVideoTrack || !this._sendTransport || this._screenVideoProducer) {
5737
5681
  this._screenVideoProducerPromise = null;
@@ -5757,9 +5701,6 @@ class VegaRtcManager {
5757
5701
  });
5758
5702
  if (this._screenVideoTrack !== this._screenVideoProducer.track)
5759
5703
  yield this._replaceScreenVideoTrack();
5760
- if (this._features.lowBandwidth) {
5761
- (_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(0);
5762
- }
5763
5704
  }
5764
5705
  catch (error) {
5765
5706
  logger$3.error("screenVideoProducer failed:%o", error);
@@ -5769,9 +5710,6 @@ class VegaRtcManager {
5769
5710
  if (!this._screenVideoTrack) {
5770
5711
  yield this._stopProducer(this._screenVideoProducer);
5771
5712
  this._screenVideoProducer = null;
5772
- if (this._features.lowBandwidth) {
5773
- (_b = this._webcamProducer) === null || _b === void 0 ? void 0 : _b.setMaxSpatialLayer(Number.MAX_VALUE);
5774
- }
5775
5713
  }
5776
5714
  }
5777
5715
  }))();
@@ -5937,7 +5875,6 @@ class VegaRtcManager {
5937
5875
  }
5938
5876
  }
5939
5877
  removeStream(streamId, _stream, requestedByClientId) {
5940
- var _a;
5941
5878
  logger$3.info("removeStream() [streamId:%s, requestedByClientId:%s]", streamId, requestedByClientId);
5942
5879
  this._emitToSignal(PROTOCOL_REQUESTS.STOP_SCREENSHARE, {
5943
5880
  streamId: OUTBOUND_SCREEN_OUTBOUND_STREAM_ID,
@@ -5949,9 +5886,6 @@ class VegaRtcManager {
5949
5886
  this._stopProducer(this._screenAudioProducer);
5950
5887
  this._screenAudioProducer = null;
5951
5888
  this._screenAudioTrack = null;
5952
- if (this._features.lowBandwidth) {
5953
- (_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(Number.MAX_VALUE);
5954
- }
5955
5889
  }
5956
5890
  _onMicAnalyserScoreUpdated(data) {
5957
5891
  var _a, _b;
@@ -8054,4 +7988,4 @@ var RtcEventNames;
8054
7988
  RtcEventNames["stream_added"] = "stream_added";
8055
7989
  })(RtcEventNames || (RtcEventNames = {}));
8056
7990
 
8057
- export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH, SCREEN_SHARE_SETTINGS_VP9, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_KEY, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
7991
+ export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_VP9, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_KEY, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
@@ -1649,31 +1649,6 @@ class RtcStream {
1649
1649
  }
1650
1650
  }
1651
1651
 
1652
- const lowPixelCount = 320 * 180;
1653
- const lowBitratePerPixel = 150000 / lowPixelCount;
1654
- const highPixelCount = 1280 * 720;
1655
- const highBitratePerPixel = 1000000 / highPixelCount;
1656
- const bitrateChangePerPixel = (highBitratePerPixel - lowBitratePerPixel) / (highPixelCount - lowPixelCount);
1657
- function getOptimalBitrate(width, height, frameRate) {
1658
- let targetPixelCount = width * height;
1659
- if (targetPixelCount < lowPixelCount)
1660
- targetPixelCount = lowPixelCount;
1661
- if (targetPixelCount > highPixelCount)
1662
- targetPixelCount = highPixelCount;
1663
- let targetBitratePerPixel = lowBitratePerPixel;
1664
- if (targetPixelCount > highPixelCount)
1665
- targetBitratePerPixel = highBitratePerPixel;
1666
- else if (targetPixelCount > lowPixelCount) {
1667
- targetBitratePerPixel += (targetPixelCount - lowPixelCount) * bitrateChangePerPixel;
1668
- }
1669
- let targetBitrate = width * height * targetBitratePerPixel;
1670
- if (frameRate <= 15)
1671
- targetBitrate = targetBitrate * 0.7;
1672
- else if (frameRate <= 24)
1673
- targetBitrate = targetBitrate * 0.9;
1674
- return targetBitrate;
1675
- }
1676
-
1677
1652
  const word = "[a-fA-F\\d:]";
1678
1653
  const boundry = (options) => options && options.includeBoundaries ? `(?:(?<=\\s|^)(?=${word})|(?<=${word})(?=\\s|$))` : "";
1679
1654
  const v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
@@ -2551,14 +2526,6 @@ const VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY = {
2551
2526
  const SCREEN_SHARE_SETTINGS = {
2552
2527
  encodings: [{}],
2553
2528
  };
2554
- const SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH = {
2555
- encodings: [
2556
- {
2557
- maxBitrate: 600000,
2558
- maxFramerate: 2,
2559
- },
2560
- ],
2561
- };
2562
2529
  const SCREEN_SHARE_SIMULCAST_SETTINGS = {
2563
2530
  encodings: [
2564
2531
  { scaleResolutionDownBy: 2, dtx: true, maxBitrate: 500000 },
@@ -2579,7 +2546,7 @@ const SCREEN_SHARE_SETTINGS_VP9 = {
2579
2546
  encodings: [{ dtx: true }],
2580
2547
  };
2581
2548
  const getMediaSettings = (kind, isScreenShare, features, isSomeoneAlreadyPresenting = false) => {
2582
- const { lowDataModeEnabled, simulcastScreenshareOn, lowBandwidth, vp9On, svcKeyScalabilityModeOn } = features;
2549
+ const { lowDataModeEnabled, simulcastScreenshareOn, vp9On, svcKeyScalabilityModeOn } = features;
2583
2550
  if (kind === "audio") {
2584
2551
  return AUDIO_SETTINGS;
2585
2552
  }
@@ -2587,7 +2554,6 @@ const getMediaSettings = (kind, isScreenShare, features, isSomeoneAlreadyPresent
2587
2554
  const isVp9Available = isChrome && vp9On;
2588
2555
  if (isScreenShare) {
2589
2556
  return getScreenShareMediaSettings({
2590
- lowBandwidth: lowBandwidth,
2591
2557
  isVp9Available,
2592
2558
  isSomeoneAlreadyPresenting,
2593
2559
  simulcastScreenshareOn,
@@ -2595,7 +2561,7 @@ const getMediaSettings = (kind, isScreenShare, features, isSomeoneAlreadyPresent
2595
2561
  }
2596
2562
  else {
2597
2563
  return getCameraMediaSettings({
2598
- lowBandwidth: lowBandwidth || lowDataModeEnabled,
2564
+ lowBandwidth: lowDataModeEnabled,
2599
2565
  isVp9Available,
2600
2566
  svcKeyScalabilityModeOn,
2601
2567
  });
@@ -2617,14 +2583,12 @@ const getCameraMediaSettings = ({ lowBandwidth, isVp9Available, svcKeyScalabilit
2617
2583
  }
2618
2584
  return VIDEO_SETTINGS_HD;
2619
2585
  };
2620
- const getScreenShareMediaSettings = ({ lowBandwidth, isVp9Available, isSomeoneAlreadyPresenting, simulcastScreenshareOn, }) => {
2586
+ const getScreenShareMediaSettings = ({ isVp9Available, isSomeoneAlreadyPresenting, simulcastScreenshareOn, }) => {
2621
2587
  if (isSomeoneAlreadyPresenting) {
2622
2588
  if (isVp9Available)
2623
2589
  return ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9;
2624
2590
  return ADDITIONAL_SCREEN_SHARE_SETTINGS;
2625
2591
  }
2626
- if (lowBandwidth && !isVp9Available)
2627
- return SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH;
2628
2592
  if (isVp9Available)
2629
2593
  return SCREEN_SHARE_SETTINGS_VP9;
2630
2594
  if (simulcastScreenshareOn)
@@ -3984,12 +3948,12 @@ class P2pRtcManager {
3984
3948
  if (numPeers > 7) {
3985
3949
  numPeers = 7;
3986
3950
  }
3987
- let bandwidth = this._features.bandwidth
3951
+ const bandwidth = this._features.bandwidth
3988
3952
  ? parseInt(this._features.bandwidth, 10)
3989
3953
  : {
3990
- 1: this._features.lowBandwidth ? 768 : 0,
3991
- 2: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 768 : 384,
3992
- 3: this._features.highP2PBandwidth && !this._features.lowBandwidth ? 512 : 256,
3954
+ 1: 0,
3955
+ 2: 384,
3956
+ 3: 256,
3993
3957
  4: 192,
3994
3958
  5: 128,
3995
3959
  6: 128,
@@ -3998,22 +3962,6 @@ class P2pRtcManager {
3998
3962
  if (bandwidth === undefined) {
3999
3963
  return 0;
4000
3964
  }
4001
- if (this._features.adjustBitratesFromResolution) {
4002
- const cameraStream = this._getLocalCameraStream();
4003
- if (cameraStream) {
4004
- const cameraTrack = cameraStream && cameraStream.getVideoTracks()[0];
4005
- if (cameraTrack) {
4006
- const { width, height, frameRate } = cameraTrack.getSettings();
4007
- if (width && height && frameRate) {
4008
- const optimalBandwidth = Math.round(getOptimalBitrate(width, height, frameRate) / 1000);
4009
- bandwidth = Math.min(optimalBandwidth, bandwidth || optimalBandwidth);
4010
- }
4011
- }
4012
- }
4013
- }
4014
- if (this._features.higherP2PBitrates && !this._features.lowBandwidth) {
4015
- bandwidth = bandwidth * 1.5;
4016
- }
4017
3965
  this._forEachPeerConnection((session) => {
4018
3966
  session.changeBandwidth(bandwidth);
4019
3967
  });
@@ -5632,7 +5580,7 @@ class VegaRtcManager {
5632
5580
  return;
5633
5581
  }
5634
5582
  this._webcamProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
5635
- var _b, _c;
5583
+ var _b;
5636
5584
  try {
5637
5585
  const currentPaused = this._webcamPaused;
5638
5586
  const producer = yield this._sendTransport.produce(Object.assign(Object.assign({ track: this._webcamTrack, disableTrackOnPause: false, stopTracks: false }, getMediaSettings("video", false, Object.assign(Object.assign({}, this._features), { vp9On: this._features.sfuVp9On }))), { appData: {
@@ -5670,9 +5618,6 @@ class VegaRtcManager {
5670
5618
  this._stopProducer(this._webcamProducer);
5671
5619
  this._webcamProducer = null;
5672
5620
  }
5673
- if (this._features.lowBandwidth && this._screenVideoTrack) {
5674
- (_c = this._webcamProducer) === null || _c === void 0 ? void 0 : _c.setMaxSpatialLayer(0);
5675
- }
5676
5621
  }
5677
5622
  }))();
5678
5623
  });
@@ -5731,7 +5676,6 @@ class VegaRtcManager {
5731
5676
  return __awaiter(this, void 0, void 0, function* () {
5732
5677
  logger$3.info("_internalSendScreenVideo()");
5733
5678
  this._screenVideoProducerPromise = (() => __awaiter(this, void 0, void 0, function* () {
5734
- var _a, _b;
5735
5679
  try {
5736
5680
  if (!this._screenVideoTrack || !this._sendTransport || this._screenVideoProducer) {
5737
5681
  this._screenVideoProducerPromise = null;
@@ -5757,9 +5701,6 @@ class VegaRtcManager {
5757
5701
  });
5758
5702
  if (this._screenVideoTrack !== this._screenVideoProducer.track)
5759
5703
  yield this._replaceScreenVideoTrack();
5760
- if (this._features.lowBandwidth) {
5761
- (_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(0);
5762
- }
5763
5704
  }
5764
5705
  catch (error) {
5765
5706
  logger$3.error("screenVideoProducer failed:%o", error);
@@ -5769,9 +5710,6 @@ class VegaRtcManager {
5769
5710
  if (!this._screenVideoTrack) {
5770
5711
  yield this._stopProducer(this._screenVideoProducer);
5771
5712
  this._screenVideoProducer = null;
5772
- if (this._features.lowBandwidth) {
5773
- (_b = this._webcamProducer) === null || _b === void 0 ? void 0 : _b.setMaxSpatialLayer(Number.MAX_VALUE);
5774
- }
5775
5713
  }
5776
5714
  }
5777
5715
  }))();
@@ -5937,7 +5875,6 @@ class VegaRtcManager {
5937
5875
  }
5938
5876
  }
5939
5877
  removeStream(streamId, _stream, requestedByClientId) {
5940
- var _a;
5941
5878
  logger$3.info("removeStream() [streamId:%s, requestedByClientId:%s]", streamId, requestedByClientId);
5942
5879
  this._emitToSignal(PROTOCOL_REQUESTS.STOP_SCREENSHARE, {
5943
5880
  streamId: OUTBOUND_SCREEN_OUTBOUND_STREAM_ID,
@@ -5949,9 +5886,6 @@ class VegaRtcManager {
5949
5886
  this._stopProducer(this._screenAudioProducer);
5950
5887
  this._screenAudioProducer = null;
5951
5888
  this._screenAudioTrack = null;
5952
- if (this._features.lowBandwidth) {
5953
- (_a = this._webcamProducer) === null || _a === void 0 ? void 0 : _a.setMaxSpatialLayer(Number.MAX_VALUE);
5954
- }
5955
5889
  }
5956
5890
  _onMicAnalyserScoreUpdated(data) {
5957
5891
  var _a, _b;
@@ -8054,5 +7988,5 @@ var RtcEventNames;
8054
7988
  RtcEventNames["stream_added"] = "stream_added";
8055
7989
  })(RtcEventNames || (RtcEventNames = {}));
8056
7990
 
8057
- export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_LOW_BANDWIDTH, SCREEN_SHARE_SETTINGS_VP9, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_KEY, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getOptimalBitrate, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
7991
+ export { ADDITIONAL_SCREEN_SHARE_SETTINGS, ADDITIONAL_SCREEN_SHARE_SETTINGS_VP9, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MAXIMUM_TURN_BANDWIDTH, MAXIMUM_TURN_BANDWIDTH_UNLIMITED, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SETTINGS_VP9, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_KEY, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH_KEY, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDevice, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, isRelayed, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
8058
7992
  //# sourceMappingURL=legacy-esm.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@whereby.com/media",
3
3
  "description": "Media library for Whereby",
4
- "version": "1.28.0",
4
+ "version": "1.29.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {