@webex/web-client-media-engine 3.30.2 → 3.30.3

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
@@ -14921,6 +14921,7 @@ const defaultMultistreamConnectionOptions = {
14921
14921
  disableContentSimulcast: true,
14922
14922
  disableAudioTwcc: true,
14923
14923
  doFullIce: BrowserInfo.isFirefox(),
14924
+ stopIceGatheringAfterFirstRelayCandidate: false,
14924
14925
  metricsCallback: () => { },
14925
14926
  };
14926
14927
  class MultistreamConnection extends EventEmitter$2 {
@@ -14934,6 +14935,7 @@ class MultistreamConnection extends EventEmitter$2 {
14934
14935
  this.midPredictor = new MidPredictor();
14935
14936
  this.offerAnswerQueue = new AsyncQueue();
14936
14937
  this.currentCreateOfferId = 0;
14938
+ this.iceCandidates = [];
14937
14939
  this.options = Object.assign(Object.assign({}, defaultMultistreamConnectionOptions), userOptions);
14938
14940
  logger.info(`Creating multistream connection with options ${JSON.stringify(this.options)}`);
14939
14941
  this.metricsCallback = this.options.metricsCallback;
@@ -14985,6 +14987,9 @@ class MultistreamConnection extends EventEmitter$2 {
14985
14987
  this.emit(MultistreamConnectionEventNames.IceGatheringStateUpdate, this.getIceGatheringState());
14986
14988
  });
14987
14989
  this.pc.on(PeerConnection.Events.IceCandidate, (candidate) => {
14990
+ if (candidate.candidate) {
14991
+ this.iceCandidates.push(candidate.candidate);
14992
+ }
14988
14993
  this.emit(MultistreamConnectionEventNames.IceCandidate, candidate);
14989
14994
  });
14990
14995
  this.pc.on(PeerConnection.Events.IceCandidateError, (error) => {
@@ -15421,6 +15426,13 @@ SCTP Max Message Size: ${maxMessageSize}`);
15421
15426
  resolve();
15422
15427
  }
15423
15428
  else {
15429
+ this.pc.on(PeerConnection.Events.IceCandidate, (candidate) => {
15430
+ if (candidate.candidate === null ||
15431
+ (this.options.stopIceGatheringAfterFirstRelayCandidate &&
15432
+ candidate.candidate.type === 'relay')) {
15433
+ resolve();
15434
+ }
15435
+ });
15424
15436
  this.pc.on(PeerConnection.Events.IceGatheringStateChange, () => {
15425
15437
  if (this.pc.iceGatheringState === 'complete') {
15426
15438
  resolve();
@@ -15583,9 +15595,14 @@ SCTP Max Message Size: ${maxMessageSize}`);
15583
15595
  });
15584
15596
  }
15585
15597
  if (BrowserInfo.isFirefox() && this.options.doFullIce) {
15586
- const { candidates } = parsedOffer.media[0].iceInfo;
15587
15598
  parsedOffer.media.forEach((media) => {
15588
- media.iceInfo.candidates = candidates;
15599
+ media.iceInfo.candidates = [];
15600
+ this.iceCandidates.forEach((iceCandidate) => {
15601
+ const candidateLine = CandidateLine.fromSdpLine(iceCandidate.candidate.toString());
15602
+ if (candidateLine) {
15603
+ media.addLine(candidateLine);
15604
+ }
15605
+ });
15589
15606
  });
15590
15607
  }
15591
15608
  if (BrowserInfo.isFirefox()) {