@webex/web-client-media-engine 3.8.4 → 3.8.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/dist/cjs/index.js CHANGED
@@ -13841,15 +13841,17 @@ class SendOnlyTransceiver extends Transceiver {
13841
13841
  this.mediaType = mediaType;
13842
13842
  }
13843
13843
  replaceSenderSource(stream) {
13844
- var _a;
13844
+ var _a, _b;
13845
13845
  return __awaiter(this, void 0, void 0, function* () {
13846
13846
  const trackOrNull = (_a = stream === null || stream === void 0 ? void 0 : stream.outputStream.getTracks()[0]) !== null && _a !== void 0 ? _a : null;
13847
- yield this.sender.replaceTrack(trackOrNull);
13848
- if (trackOrNull) {
13849
- logger.log(`Sender source for ${this.mediaType} replaced with track ID ${trackOrNull.id}`);
13850
- }
13851
- else {
13852
- logger.log(`Sender source for ${this.mediaType} set to null, sender stopped`);
13847
+ if (((_b = this.sender.track) === null || _b === void 0 ? void 0 : _b.id) !== (trackOrNull === null || trackOrNull === void 0 ? void 0 : trackOrNull.id)) {
13848
+ yield this.sender.replaceTrack(trackOrNull);
13849
+ if (trackOrNull) {
13850
+ logger.log(`Sender source for ${this.mediaType} replaced with track ID ${trackOrNull.id}`);
13851
+ }
13852
+ else {
13853
+ logger.log(`Sender source for ${this.mediaType} set to null, sender stopped`);
13854
+ }
13853
13855
  }
13854
13856
  });
13855
13857
  }
@@ -13934,29 +13936,27 @@ class SendOnlyTransceiver extends Transceiver {
13934
13936
  updateSendParameters(requestedIdEncodingParamsMap) {
13935
13937
  return __awaiter(this, void 0, void 0, function* () {
13936
13938
  return this.updateSendParametersQueue.push(() => __awaiter(this, void 0, void 0, function* () {
13937
- if (this.publishedStream) {
13938
- const requested = requestedIdEncodingParamsMap.size > 0;
13939
- if (this.requested !== requested) {
13940
- this.replaceSenderSource(requested ? this.publishedStream : null);
13941
- }
13942
- const sendParameters = this.sender.getParameters();
13943
- sendParameters.encodings.forEach((encoding, index) => {
13944
- var _a, _b;
13945
- const encodingParams = requestedIdEncodingParamsMap.get(index);
13946
- encoding.active = !!encodingParams;
13947
- if (encodingParams) {
13948
- const { maxPayloadBitsPerSecond, maxFs, maxWidth, maxHeight } = encodingParams;
13949
- const scaleDownRatio = getScaleDownRatio((_a = this.publishedStream) === null || _a === void 0 ? void 0 : _a.getSettings().width, (_b = this.publishedStream) === null || _b === void 0 ? void 0 : _b.getSettings().height, maxFs, maxWidth, maxHeight);
13950
- if (maxPayloadBitsPerSecond !== undefined && maxPayloadBitsPerSecond >= 0) {
13951
- encoding.maxBitrate = maxPayloadBitsPerSecond;
13952
- }
13953
- if (scaleDownRatio !== undefined && scaleDownRatio >= 1.0) {
13954
- encoding.scaleResolutionDownBy = scaleDownRatio;
13955
- }
13956
- }
13957
- });
13958
- yield this.sender.setParameters(sendParameters);
13939
+ const requested = requestedIdEncodingParamsMap.size > 0;
13940
+ if (this.requested !== requested) {
13941
+ yield this.replaceSenderSource(requested ? this.publishedStream : null);
13959
13942
  }
13943
+ const sendParameters = this.sender.getParameters();
13944
+ sendParameters.encodings.forEach((encoding, index) => {
13945
+ var _a, _b;
13946
+ const encodingParams = requestedIdEncodingParamsMap.get(index);
13947
+ encoding.active = !!encodingParams;
13948
+ if (encodingParams) {
13949
+ const { maxPayloadBitsPerSecond, maxFs, maxWidth, maxHeight } = encodingParams;
13950
+ const scaleDownRatio = getScaleDownRatio((_a = this.publishedStream) === null || _a === void 0 ? void 0 : _a.getSettings().width, (_b = this.publishedStream) === null || _b === void 0 ? void 0 : _b.getSettings().height, maxFs, maxWidth, maxHeight);
13951
+ if (maxPayloadBitsPerSecond !== undefined && maxPayloadBitsPerSecond >= 0) {
13952
+ encoding.maxBitrate = maxPayloadBitsPerSecond;
13953
+ }
13954
+ if (scaleDownRatio !== undefined && scaleDownRatio >= 1.0) {
13955
+ encoding.scaleResolutionDownBy = scaleDownRatio;
13956
+ }
13957
+ }
13958
+ });
13959
+ yield this.sender.setParameters(sendParameters);
13960
13960
  this.requestedIdEncodingParamsMap = requestedIdEncodingParamsMap;
13961
13961
  }));
13962
13962
  });
package/dist/esm/index.js CHANGED
@@ -13837,15 +13837,17 @@ class SendOnlyTransceiver extends Transceiver {
13837
13837
  this.mediaType = mediaType;
13838
13838
  }
13839
13839
  replaceSenderSource(stream) {
13840
- var _a;
13840
+ var _a, _b;
13841
13841
  return __awaiter(this, void 0, void 0, function* () {
13842
13842
  const trackOrNull = (_a = stream === null || stream === void 0 ? void 0 : stream.outputStream.getTracks()[0]) !== null && _a !== void 0 ? _a : null;
13843
- yield this.sender.replaceTrack(trackOrNull);
13844
- if (trackOrNull) {
13845
- logger.log(`Sender source for ${this.mediaType} replaced with track ID ${trackOrNull.id}`);
13846
- }
13847
- else {
13848
- logger.log(`Sender source for ${this.mediaType} set to null, sender stopped`);
13843
+ if (((_b = this.sender.track) === null || _b === void 0 ? void 0 : _b.id) !== (trackOrNull === null || trackOrNull === void 0 ? void 0 : trackOrNull.id)) {
13844
+ yield this.sender.replaceTrack(trackOrNull);
13845
+ if (trackOrNull) {
13846
+ logger.log(`Sender source for ${this.mediaType} replaced with track ID ${trackOrNull.id}`);
13847
+ }
13848
+ else {
13849
+ logger.log(`Sender source for ${this.mediaType} set to null, sender stopped`);
13850
+ }
13849
13851
  }
13850
13852
  });
13851
13853
  }
@@ -13930,29 +13932,27 @@ class SendOnlyTransceiver extends Transceiver {
13930
13932
  updateSendParameters(requestedIdEncodingParamsMap) {
13931
13933
  return __awaiter(this, void 0, void 0, function* () {
13932
13934
  return this.updateSendParametersQueue.push(() => __awaiter(this, void 0, void 0, function* () {
13933
- if (this.publishedStream) {
13934
- const requested = requestedIdEncodingParamsMap.size > 0;
13935
- if (this.requested !== requested) {
13936
- this.replaceSenderSource(requested ? this.publishedStream : null);
13937
- }
13938
- const sendParameters = this.sender.getParameters();
13939
- sendParameters.encodings.forEach((encoding, index) => {
13940
- var _a, _b;
13941
- const encodingParams = requestedIdEncodingParamsMap.get(index);
13942
- encoding.active = !!encodingParams;
13943
- if (encodingParams) {
13944
- const { maxPayloadBitsPerSecond, maxFs, maxWidth, maxHeight } = encodingParams;
13945
- const scaleDownRatio = getScaleDownRatio((_a = this.publishedStream) === null || _a === void 0 ? void 0 : _a.getSettings().width, (_b = this.publishedStream) === null || _b === void 0 ? void 0 : _b.getSettings().height, maxFs, maxWidth, maxHeight);
13946
- if (maxPayloadBitsPerSecond !== undefined && maxPayloadBitsPerSecond >= 0) {
13947
- encoding.maxBitrate = maxPayloadBitsPerSecond;
13948
- }
13949
- if (scaleDownRatio !== undefined && scaleDownRatio >= 1.0) {
13950
- encoding.scaleResolutionDownBy = scaleDownRatio;
13951
- }
13952
- }
13953
- });
13954
- yield this.sender.setParameters(sendParameters);
13935
+ const requested = requestedIdEncodingParamsMap.size > 0;
13936
+ if (this.requested !== requested) {
13937
+ yield this.replaceSenderSource(requested ? this.publishedStream : null);
13955
13938
  }
13939
+ const sendParameters = this.sender.getParameters();
13940
+ sendParameters.encodings.forEach((encoding, index) => {
13941
+ var _a, _b;
13942
+ const encodingParams = requestedIdEncodingParamsMap.get(index);
13943
+ encoding.active = !!encodingParams;
13944
+ if (encodingParams) {
13945
+ const { maxPayloadBitsPerSecond, maxFs, maxWidth, maxHeight } = encodingParams;
13946
+ const scaleDownRatio = getScaleDownRatio((_a = this.publishedStream) === null || _a === void 0 ? void 0 : _a.getSettings().width, (_b = this.publishedStream) === null || _b === void 0 ? void 0 : _b.getSettings().height, maxFs, maxWidth, maxHeight);
13947
+ if (maxPayloadBitsPerSecond !== undefined && maxPayloadBitsPerSecond >= 0) {
13948
+ encoding.maxBitrate = maxPayloadBitsPerSecond;
13949
+ }
13950
+ if (scaleDownRatio !== undefined && scaleDownRatio >= 1.0) {
13951
+ encoding.scaleResolutionDownBy = scaleDownRatio;
13952
+ }
13953
+ }
13954
+ });
13955
+ yield this.sender.setParameters(sendParameters);
13956
13956
  this.requestedIdEncodingParamsMap = requestedIdEncodingParamsMap;
13957
13957
  }));
13958
13958
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/web-client-media-engine",
3
- "version": "3.8.4",
3
+ "version": "3.8.5",
4
4
  "description": "Web Client Media Engine is common web code for interacting with the multistream media server.",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/cjs/index.js",