@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/cjs/index.js CHANGED
@@ -14925,6 +14925,7 @@ const defaultMultistreamConnectionOptions = {
14925
14925
  disableContentSimulcast: true,
14926
14926
  disableAudioTwcc: true,
14927
14927
  doFullIce: BrowserInfo.isFirefox(),
14928
+ stopIceGatheringAfterFirstRelayCandidate: false,
14928
14929
  metricsCallback: () => { },
14929
14930
  };
14930
14931
  class MultistreamConnection extends EventEmitter$2 {
@@ -14938,6 +14939,7 @@ class MultistreamConnection extends EventEmitter$2 {
14938
14939
  this.midPredictor = new MidPredictor();
14939
14940
  this.offerAnswerQueue = new AsyncQueue();
14940
14941
  this.currentCreateOfferId = 0;
14942
+ this.iceCandidates = [];
14941
14943
  this.options = Object.assign(Object.assign({}, defaultMultistreamConnectionOptions), userOptions);
14942
14944
  logger.info(`Creating multistream connection with options ${JSON.stringify(this.options)}`);
14943
14945
  this.metricsCallback = this.options.metricsCallback;
@@ -14989,6 +14991,9 @@ class MultistreamConnection extends EventEmitter$2 {
14989
14991
  this.emit(exports.MultistreamConnectionEventNames.IceGatheringStateUpdate, this.getIceGatheringState());
14990
14992
  });
14991
14993
  this.pc.on(PeerConnection.Events.IceCandidate, (candidate) => {
14994
+ if (candidate.candidate) {
14995
+ this.iceCandidates.push(candidate.candidate);
14996
+ }
14992
14997
  this.emit(exports.MultistreamConnectionEventNames.IceCandidate, candidate);
14993
14998
  });
14994
14999
  this.pc.on(PeerConnection.Events.IceCandidateError, (error) => {
@@ -15425,6 +15430,13 @@ SCTP Max Message Size: ${maxMessageSize}`);
15425
15430
  resolve();
15426
15431
  }
15427
15432
  else {
15433
+ this.pc.on(PeerConnection.Events.IceCandidate, (candidate) => {
15434
+ if (candidate.candidate === null ||
15435
+ (this.options.stopIceGatheringAfterFirstRelayCandidate &&
15436
+ candidate.candidate.type === 'relay')) {
15437
+ resolve();
15438
+ }
15439
+ });
15428
15440
  this.pc.on(PeerConnection.Events.IceGatheringStateChange, () => {
15429
15441
  if (this.pc.iceGatheringState === 'complete') {
15430
15442
  resolve();
@@ -15587,9 +15599,14 @@ SCTP Max Message Size: ${maxMessageSize}`);
15587
15599
  });
15588
15600
  }
15589
15601
  if (BrowserInfo.isFirefox() && this.options.doFullIce) {
15590
- const { candidates } = parsedOffer.media[0].iceInfo;
15591
15602
  parsedOffer.media.forEach((media) => {
15592
- media.iceInfo.candidates = candidates;
15603
+ media.iceInfo.candidates = [];
15604
+ this.iceCandidates.forEach((iceCandidate) => {
15605
+ const candidateLine = CandidateLine.fromSdpLine(iceCandidate.candidate.toString());
15606
+ if (candidateLine) {
15607
+ media.addLine(candidateLine);
15608
+ }
15609
+ });
15593
15610
  });
15594
15611
  }
15595
15612
  if (BrowserInfo.isFirefox()) {