@webex/web-client-media-engine 3.31.4 → 3.31.5

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
@@ -5926,6 +5926,7 @@ class PeerConnection extends EventEmitter$4 {
5926
5926
  */
5927
5927
  constructor(configuration) {
5928
5928
  super();
5929
+ this.iceCandidates = [];
5929
5930
  logger$3.log('PeerConnection init');
5930
5931
  this.pc = createRTCPeerConnection(configuration);
5931
5932
  this.connectionStateHandler = new ConnectionStateHandler(() => {
@@ -5952,6 +5953,9 @@ class PeerConnection extends EventEmitter$4 {
5952
5953
  };
5953
5954
  /* eslint-disable jsdoc/require-jsdoc */
5954
5955
  this.pc.onicecandidate = (ev) => {
5956
+ if (ev.candidate) {
5957
+ this.iceCandidates.push(ev.candidate);
5958
+ }
5955
5959
  this.emit(PeerConnection.Events.IceCandidate, ev);
5956
5960
  };
5957
5961
  this.pc.onicecandidateerror = (ev) => {
@@ -5990,6 +5994,14 @@ class PeerConnection extends EventEmitter$4 {
5990
5994
  getIceConnectionState() {
5991
5995
  return this.connectionStateHandler.getIceConnectionState();
5992
5996
  }
5997
+ /**
5998
+ * Gets the list of ICE candidates that have been gathered.
5999
+ *
6000
+ * @returns An array of RTCIceCandidate objects representing the ICE candidates.
6001
+ */
6002
+ getIceCandidates() {
6003
+ return this.iceCandidates;
6004
+ }
5993
6005
  /**
5994
6006
  * Adds a new media track to the set of tracks which will be transmitted to the other peer.
5995
6007
  *
@@ -14955,7 +14967,6 @@ class MultistreamConnection extends EventEmitter$2 {
14955
14967
  this.midPredictor = new MidPredictor();
14956
14968
  this.offerAnswerQueue = new AsyncQueue();
14957
14969
  this.currentCreateOfferId = 0;
14958
- this.iceCandidates = [];
14959
14970
  this.metadata = { isMediaBypassEdge: false };
14960
14971
  this.options = Object.assign(Object.assign({}, defaultMultistreamConnectionOptions), userOptions);
14961
14972
  logger.info(`Creating multistream connection with options ${JSON.stringify(this.options)}`);
@@ -15006,9 +15017,6 @@ class MultistreamConnection extends EventEmitter$2 {
15006
15017
  this.emit(exports.MultistreamConnectionEventNames.IceGatheringStateUpdate, this.getIceGatheringState());
15007
15018
  });
15008
15019
  this.pc.on(PeerConnection.Events.IceCandidate, (candidate) => {
15009
- if (candidate.candidate) {
15010
- this.iceCandidates.push(candidate.candidate);
15011
- }
15012
15020
  this.emit(exports.MultistreamConnectionEventNames.IceCandidate, candidate);
15013
15021
  });
15014
15022
  this.pc.on(PeerConnection.Events.IceCandidateError, (error) => {
@@ -15615,9 +15623,10 @@ SCTP Max Message Size: ${maxMessageSize}`);
15615
15623
  });
15616
15624
  }
15617
15625
  if (BrowserInfo.isFirefox() && this.options.doFullIce) {
15626
+ const iceCandidates = this.pc.getIceCandidates();
15618
15627
  parsedOffer.media.forEach((media) => {
15619
15628
  media.iceInfo.candidates = [];
15620
- this.iceCandidates.forEach((iceCandidate) => {
15629
+ iceCandidates.forEach((iceCandidate) => {
15621
15630
  const candidateLine = CandidateLine.fromSdpLine(iceCandidate.candidate.toString());
15622
15631
  if (candidateLine) {
15623
15632
  media.addLine(candidateLine);