@webex/web-client-media-engine 3.32.0 → 3.33.1

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/esm/index.js CHANGED
@@ -7540,6 +7540,7 @@ var MediaCodecMimeType;
7540
7540
  })(MediaCodecMimeType || (MediaCodecMimeType = {}));
7541
7541
  const defaultMaxVideoEncodeFrameSize = 8160;
7542
7542
  const defaultMaxVideoEncodeMbps = 244800;
7543
+ const defaultStartBitrateKbps = 3000;
7543
7544
  var RecommendedOpusBitrates;
7544
7545
  (function (RecommendedOpusBitrates) {
7545
7546
  RecommendedOpusBitrates[RecommendedOpusBitrates["NB"] = 12000] = "NB";
@@ -9951,14 +9952,12 @@ class EgressSdpMunger {
9951
9952
  logger.log(`Some unsupported remote candidates have been removed from mid ${mediaDescription.mid}`);
9952
9953
  }
9953
9954
  mediaDescription.bandwidth = undefined;
9954
- [...mediaDescription.codecs.values()].forEach((ci) => {
9955
- ci.fmtParams.set('x-google-start-bitrate', '60000');
9956
- });
9957
9955
  if (mediaDescription.type === 'audio') {
9958
9956
  [...mediaDescription.codecs.values()].forEach((ci) => {
9959
9957
  ci.fmtParams.set('usedtx', mungeOptions.dtxDisabled ? '0' : '1');
9960
9958
  });
9961
9959
  }
9960
+ applyFormatParameters(mediaDescription, ['H264', 'opus'], this.customCodecParameters);
9962
9961
  }
9963
9962
  getSenderIds() {
9964
9963
  return this.streamIds;
@@ -10494,9 +10493,6 @@ class IngressSdpMunger {
10494
10493
  if (retainCandidatesByTransportType(mediaDescription, ['udp', 'tcp'])) {
10495
10494
  logger.log(`Some unsupported remote candidates have been removed from mid ${mediaDescription.mid}`);
10496
10495
  }
10497
- [...mediaDescription.codecs.values()].forEach((ci) => {
10498
- ci.fmtParams.set('x-google-start-bitrate', '60000');
10499
- });
10500
10496
  applyFormatParameters(mediaDescription, ['rtx'], this.customRtxCodecParameters);
10501
10497
  }
10502
10498
  setCodecParameters(parameters) {
@@ -14969,6 +14965,7 @@ const defaultMultistreamConnectionOptions = {
14969
14965
  doFullIce: BrowserInfo.isFirefox(),
14970
14966
  stopIceGatheringAfterFirstRelayCandidate: false,
14971
14967
  disableAudioMainDtx: true,
14968
+ preferredStartingBitrateKbps: defaultStartBitrateKbps,
14972
14969
  metricsCallback: () => { },
14973
14970
  };
14974
14971
  class MultistreamConnection extends EventEmitter$2 {
@@ -15087,13 +15084,14 @@ class MultistreamConnection extends EventEmitter$2 {
15087
15084
  munger,
15088
15085
  csi,
15089
15086
  });
15087
+ let codecParameters = {
15088
+ 'x-google-start-bitrate': `${this.options.preferredStartingBitrateKbps}`,
15089
+ };
15090
15090
  if (getMediaFamily(mediaType) === MediaFamily.Video) {
15091
15091
  transceiver.rtxEnabled = true;
15092
- transceiver.setCodecParameters({
15093
- 'max-mbps': `${defaultMaxVideoEncodeMbps}`,
15094
- 'max-fs': `${defaultMaxVideoEncodeFrameSize}`,
15095
- });
15092
+ codecParameters = Object.assign(Object.assign({}, codecParameters), { 'max-mbps': `${defaultMaxVideoEncodeMbps}`, 'max-fs': `${defaultMaxVideoEncodeFrameSize}` });
15096
15093
  }
15094
+ transceiver.setCodecParameters(codecParameters);
15097
15095
  transceiver.twccDisabled =
15098
15096
  getMediaFamily(mediaType) === MediaFamily.Audio ? this.options.disableAudioTwcc : false;
15099
15097
  transceiver.dtxDisabled = mediaType !== MediaType.AudioMain || this.options.disableAudioMainDtx;
@@ -15471,21 +15469,24 @@ SCTP Max Message Size: ${maxMessageSize}`);
15471
15469
  }
15472
15470
  waitForIceGatheringComplete() {
15473
15471
  return __awaiter$1(this, void 0, void 0, function* () {
15474
- return new Promise((resolve) => {
15472
+ return new Promise((resolve, reject) => {
15473
+ const finalizeIceCandidatesGathering = () => this.pc.getIceCandidates().length > 0
15474
+ ? resolve()
15475
+ : reject(new Error('No ICE candidates gathered.'));
15475
15476
  if (this.pc.iceGatheringState === 'complete') {
15476
- resolve();
15477
+ finalizeIceCandidatesGathering();
15477
15478
  }
15478
15479
  else {
15479
15480
  this.pc.on(PeerConnection.Events.IceCandidate, (candidate) => {
15480
15481
  if (candidate.candidate === null ||
15481
15482
  (this.options.stopIceGatheringAfterFirstRelayCandidate &&
15482
15483
  candidate.candidate.type === 'relay')) {
15483
- resolve();
15484
+ finalizeIceCandidatesGathering();
15484
15485
  }
15485
15486
  });
15486
15487
  this.pc.on(PeerConnection.Events.IceGatheringStateChange, () => {
15487
15488
  if (this.pc.iceGatheringState === 'complete') {
15488
- resolve();
15489
+ finalizeIceCandidatesGathering();
15489
15490
  }
15490
15491
  });
15491
15492
  }
@@ -15522,7 +15523,12 @@ SCTP Max Message Size: ${maxMessageSize}`);
15522
15523
  logErrorAndThrow(WcmeErrorType.CREATE_OFFER_FAILED, `Error: ${error}. SDP: ${maskIp((_a = offer.sdp) !== null && _a !== void 0 ? _a : '')}`);
15523
15524
  });
15524
15525
  if (this.options.doFullIce) {
15525
- yield this.waitForIceGatheringComplete();
15526
+ try {
15527
+ yield this.waitForIceGatheringComplete();
15528
+ }
15529
+ catch (error) {
15530
+ logErrorAndThrow(WcmeErrorType.CREATE_OFFER_FAILED, `${error}`);
15531
+ }
15526
15532
  }
15527
15533
  const sdpToSend = this.prepareLocalOfferForRemoteServer((_a = this.pc.getLocalDescription()) === null || _a === void 0 ? void 0 : _a.sdp);
15528
15534
  createOfferResolve({ type: 'offer', sdp: sdpToSend });