@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/cjs/index.js CHANGED
@@ -9751,9 +9751,10 @@ function generateSsrc() {
9751
9751
  }
9752
9752
 
9753
9753
  class EgressSdpMunger {
9754
- constructor() {
9754
+ constructor(options) {
9755
9755
  this.streamIds = [];
9756
9756
  this.customCodecParameters = new Map();
9757
+ this.egressMungerOptions = options;
9757
9758
  }
9758
9759
  reset() {
9759
9760
  this.streamIds = [];
@@ -9842,7 +9843,9 @@ class EgressSdpMunger {
9842
9843
  mungeLocalDescriptionForRemoteServer(mediaDescription, mediaContent, csi) {
9843
9844
  injectContentType(mediaDescription, mediaContent);
9844
9845
  injectJmpAttributes(mediaDescription, csi, 'SSRC');
9845
- injectDummyCandidates(mediaDescription);
9846
+ if (!this.egressMungerOptions.doFullIce) {
9847
+ injectDummyCandidates(mediaDescription);
9848
+ }
9846
9849
  if (mediaDescription.type === 'video') {
9847
9850
  const ssrcGroup = mediaDescription.ssrcGroups.find((sg) => sg.semantics === 'SIM');
9848
9851
  if (ssrcGroup) {
@@ -14757,6 +14760,7 @@ const defaultMultistreamConnectionOptions = {
14757
14760
  iceServers: undefined,
14758
14761
  disableContentSimulcast: true,
14759
14762
  disableAudioTwcc: true,
14763
+ doFullIce: BrowserInfo.isFirefox(),
14760
14764
  };
14761
14765
  class MultistreamConnection extends EventEmitter$2 {
14762
14766
  constructor(userOptions = {}) {
@@ -14863,7 +14867,9 @@ class MultistreamConnection extends EventEmitter$2 {
14863
14867
  }
14864
14868
  const mid = this.midPredictor.getNextMid(mediaType);
14865
14869
  const csi = generateCsi(getMediaFamily(mediaType), sceneId);
14866
- const munger = new EgressSdpMunger();
14870
+ const munger = new EgressSdpMunger({
14871
+ doFullIce: this.options.doFullIce,
14872
+ });
14867
14873
  const transceiver = new SendOnlyTransceiver(rtcTransceiver, mid, csi, munger, mediaType);
14868
14874
  if (getMediaFamily(mediaType) === exports.MediaFamily.Video) {
14869
14875
  transceiver.rtxEnabled = true;
@@ -15221,6 +15227,22 @@ SCTP Max Message Size: ${maxMessageSize}`);
15221
15227
  }
15222
15228
  return targetCodec.pt;
15223
15229
  }
15230
+ waitForIceGatheringComplete() {
15231
+ return __awaiter$1(this, void 0, void 0, function* () {
15232
+ return new Promise((resolve) => {
15233
+ if (this.pc.iceGatheringState === 'complete') {
15234
+ resolve();
15235
+ }
15236
+ else {
15237
+ this.pc.on(PeerConnection.Events.IceGatheringStateChange, () => {
15238
+ if (this.pc.iceGatheringState === 'complete') {
15239
+ resolve();
15240
+ }
15241
+ });
15242
+ }
15243
+ });
15244
+ });
15245
+ }
15224
15246
  createOffer() {
15225
15247
  return __awaiter$1(this, void 0, void 0, function* () {
15226
15248
  if (!this.pc.getLocalDescription()) {
@@ -15250,6 +15272,9 @@ SCTP Max Message Size: ${maxMessageSize}`);
15250
15272
  var _a;
15251
15273
  logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, `Error: ${error}. SDP: ${maskIp((_a = offer.sdp) !== null && _a !== void 0 ? _a : '')}`);
15252
15274
  });
15275
+ if (this.options.doFullIce) {
15276
+ yield this.waitForIceGatheringComplete();
15277
+ }
15253
15278
  const sdpToSend = this.prepareLocalOfferForRemoteServer((_a = this.pc.getLocalDescription()) === null || _a === void 0 ? void 0 : _a.sdp);
15254
15279
  createOfferResolve({ type: 'offer', sdp: sdpToSend });
15255
15280
  if (this.currentCreateOfferId > createOfferId) {
@@ -15354,11 +15379,13 @@ SCTP Max Message Size: ${maxMessageSize}`);
15354
15379
  const sendTransceiver = this.getSendTransceiverByMidOrThrow(av.mid);
15355
15380
  sendTransceiver.mungeLocalDescriptionForRemoteServer(av);
15356
15381
  });
15357
- parsedOffer.media
15358
- .filter((media) => media instanceof ApplicationMediaDescription)
15359
- .forEach((media) => {
15360
- injectDummyCandidates(media);
15361
- });
15382
+ if (!this.options.doFullIce) {
15383
+ parsedOffer.media
15384
+ .filter((media) => media instanceof ApplicationMediaDescription)
15385
+ .forEach((media) => {
15386
+ injectDummyCandidates(media);
15387
+ });
15388
+ }
15362
15389
  if (BrowserInfo.isFirefox()) {
15363
15390
  setupBundle(parsedOffer, this.options.bundlePolicy, this.midPredictor.getMidMap());
15364
15391
  if (this.options.bundlePolicy === 'max-bundle') {