@webex/web-client-media-engine 3.22.1 → 3.22.2

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
@@ -9747,9 +9747,10 @@ function generateSsrc() {
9747
9747
  }
9748
9748
 
9749
9749
  class EgressSdpMunger {
9750
- constructor() {
9750
+ constructor(options) {
9751
9751
  this.streamIds = [];
9752
9752
  this.customCodecParameters = new Map();
9753
+ this.egressMungerOptions = options;
9753
9754
  }
9754
9755
  reset() {
9755
9756
  this.streamIds = [];
@@ -9838,7 +9839,9 @@ class EgressSdpMunger {
9838
9839
  mungeLocalDescriptionForRemoteServer(mediaDescription, mediaContent, csi) {
9839
9840
  injectContentType(mediaDescription, mediaContent);
9840
9841
  injectJmpAttributes(mediaDescription, csi, 'SSRC');
9841
- injectDummyCandidates(mediaDescription);
9842
+ if (!this.egressMungerOptions.doFullIce) {
9843
+ injectDummyCandidates(mediaDescription);
9844
+ }
9842
9845
  if (mediaDescription.type === 'video') {
9843
9846
  const ssrcGroup = mediaDescription.ssrcGroups.find((sg) => sg.semantics === 'SIM');
9844
9847
  if (ssrcGroup) {
@@ -14753,6 +14756,7 @@ const defaultMultistreamConnectionOptions = {
14753
14756
  iceServers: undefined,
14754
14757
  disableContentSimulcast: true,
14755
14758
  disableAudioTwcc: true,
14759
+ doFullIce: BrowserInfo.isFirefox(),
14756
14760
  };
14757
14761
  class MultistreamConnection extends EventEmitter$2 {
14758
14762
  constructor(userOptions = {}) {
@@ -14859,7 +14863,9 @@ class MultistreamConnection extends EventEmitter$2 {
14859
14863
  }
14860
14864
  const mid = this.midPredictor.getNextMid(mediaType);
14861
14865
  const csi = generateCsi(getMediaFamily(mediaType), sceneId);
14862
- const munger = new EgressSdpMunger();
14866
+ const munger = new EgressSdpMunger({
14867
+ doFullIce: this.options.doFullIce,
14868
+ });
14863
14869
  const transceiver = new SendOnlyTransceiver(rtcTransceiver, mid, csi, munger, mediaType);
14864
14870
  if (getMediaFamily(mediaType) === MediaFamily.Video) {
14865
14871
  transceiver.rtxEnabled = true;
@@ -15217,6 +15223,22 @@ SCTP Max Message Size: ${maxMessageSize}`);
15217
15223
  }
15218
15224
  return targetCodec.pt;
15219
15225
  }
15226
+ waitForIceGatheringComplete() {
15227
+ return __awaiter$1(this, void 0, void 0, function* () {
15228
+ return new Promise((resolve) => {
15229
+ if (this.pc.iceGatheringState === 'complete') {
15230
+ resolve();
15231
+ }
15232
+ else {
15233
+ this.pc.on(PeerConnection.Events.IceGatheringStateChange, () => {
15234
+ if (this.pc.iceGatheringState === 'complete') {
15235
+ resolve();
15236
+ }
15237
+ });
15238
+ }
15239
+ });
15240
+ });
15241
+ }
15220
15242
  createOffer() {
15221
15243
  return __awaiter$1(this, void 0, void 0, function* () {
15222
15244
  if (!this.pc.getLocalDescription()) {
@@ -15246,6 +15268,9 @@ SCTP Max Message Size: ${maxMessageSize}`);
15246
15268
  var _a;
15247
15269
  logErrorAndThrow(WcmeErrorType.CREATE_OFFER_FAILED, `Error: ${error}. SDP: ${maskIp((_a = offer.sdp) !== null && _a !== void 0 ? _a : '')}`);
15248
15270
  });
15271
+ if (this.options.doFullIce) {
15272
+ yield this.waitForIceGatheringComplete();
15273
+ }
15249
15274
  const sdpToSend = this.prepareLocalOfferForRemoteServer((_a = this.pc.getLocalDescription()) === null || _a === void 0 ? void 0 : _a.sdp);
15250
15275
  createOfferResolve({ type: 'offer', sdp: sdpToSend });
15251
15276
  if (this.currentCreateOfferId > createOfferId) {
@@ -15350,11 +15375,13 @@ SCTP Max Message Size: ${maxMessageSize}`);
15350
15375
  const sendTransceiver = this.getSendTransceiverByMidOrThrow(av.mid);
15351
15376
  sendTransceiver.mungeLocalDescriptionForRemoteServer(av);
15352
15377
  });
15353
- parsedOffer.media
15354
- .filter((media) => media instanceof ApplicationMediaDescription)
15355
- .forEach((media) => {
15356
- injectDummyCandidates(media);
15357
- });
15378
+ if (!this.options.doFullIce) {
15379
+ parsedOffer.media
15380
+ .filter((media) => media instanceof ApplicationMediaDescription)
15381
+ .forEach((media) => {
15382
+ injectDummyCandidates(media);
15383
+ });
15384
+ }
15358
15385
  if (BrowserInfo.isFirefox()) {
15359
15386
  setupBundle(parsedOffer, this.options.bundlePolicy, this.midPredictor.getMidMap());
15360
15387
  if (this.options.bundlePolicy === 'max-bundle') {